Android String Decode decode(String sourceStr, String compareStr, String returnStr)

Here you can find the source of decode(String sourceStr, String compareStr, String returnStr)

Description

decode

Declaration

public static String decode(String sourceStr, String compareStr,
        String returnStr) 

Method Source Code

//package com.java2s;

public class Main {

    public static String decode(String sourceStr, String compareStr,
            String returnStr, String defaultStr) {
        if (sourceStr == null && compareStr == null) {
            return returnStr;
        }//from   w w  w  . java2 s.  co m

        if (sourceStr == null && compareStr != null) {
            return defaultStr;
        }

        if (sourceStr.trim().equals(compareStr)) {
            return returnStr;
        }

        return defaultStr;
    }

    public static String decode(String sourceStr, String compareStr,
            String returnStr) {
        return decode(sourceStr, compareStr, returnStr, sourceStr);
    }
}

Related

  1. decode(@Nonnull final String input)
  2. decode(@Nonnull final String input)
  3. decode(String s)
  4. decode(String str, int flags)
  5. decodeWebSafe(String s)
  6. decode(String sourceStr, String compareStr, String returnStr, String defaultStr)
  7. decode(String str)
  8. decode(String str)
  9. decode(String base64)