Package org.picketbox.util
Class StringUtil
- java.lang.Object
-
- org.picketbox.util.StringUtil
-
public class StringUtil extends Object
Utility dealing with Strings- Since:
- Oct 21, 2009
- Author:
- Anil.Saldhana@redhat.com
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_DEFAULT_SEPARATOR
-
Constructor Summary
Constructors Constructor Description StringUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
decode(String maskedString, String salt, int iterationCount)
Given a masked passwordString
, decode itstatic String
getSystemPropertyAsString(String str)
Get the system property value if the string is of the format ${sysproperty}static boolean
isNotNull(String str)
Check whether the passed string is null or emptystatic boolean
isNullOrEmpty(String str)
Check whether the string is null or emptystatic void
match(String first, String second)
Match two strings else throw aRuntimeException
static List<String>
tokenize(String str)
Given a comma separated string, get the tokens as aList
-
-
-
Field Detail
-
PROPERTY_DEFAULT_SEPARATOR
public static final String PROPERTY_DEFAULT_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
isNotNull
public static boolean isNotNull(String str)
Check whether the passed string is null or empty- Parameters:
str
-- Returns:
-
isNullOrEmpty
public static boolean isNullOrEmpty(String str)
Check whether the string is null or empty- Parameters:
str
-- Returns:
-
getSystemPropertyAsString
public static String getSystemPropertyAsString(String str)
Get the system property value if the string is of the format ${sysproperty}
You can insert default value when the system property is not set, by separating it at the beginning with ::
Examples:
${idp} should resolve to a value if the system property "idp" is set.
${idp::http://localhost:8080} will resolve to http://localhost:8080 if the system property "idp" is not set.
- Parameters:
str
-- Returns:
-
match
public static void match(String first, String second)
Match two strings else throw aRuntimeException
- Parameters:
first
-second
-
-
tokenize
public static List<String> tokenize(String str)
Given a comma separated string, get the tokens as aList
- Parameters:
str
-- Returns:
-
-