Here you can find the source of decode(String sourceStr, String compareStr, String returnStr)
public static String decode(String sourceStr, String compareStr, String returnStr)
//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); } }