Here you can find the source of decode(String value)
Parameter | Description |
---|---|
value | a parameter |
public static String decode(String value)
//package com.java2s; import java.util.Collection; import java.util.Map; public class Main { public static String decode(String value) { if (isEmpty(value)) { return ""; }/*from w w w .j a v a 2 s .c o m*/ try { return java.net.URLDecoder.decode(value, "utf-8"); } catch (Exception ex) { ex.printStackTrace(); } return value; } public static boolean isEmpty(String input) { return (input == null || input.length() == 0); } @SuppressWarnings("rawtypes") public static boolean isEmpty(Object pObj) { if (pObj == null) return true; if (pObj == "") return true; if (pObj instanceof String) { if (((String) pObj).length() == 0) { return true; } } else if (pObj instanceof Collection) { if (((Collection) pObj).size() == 0) { return true; } } else if (pObj instanceof Map) { if (((Map) pObj).size() == 0) { return true; } } return false; } public static String isEmpty(String input, String errorMsg) { if (isEmpty(input)) { return errorMsg; } return ""; } }