|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xenonsoft.bridgetown.soa.StringUtils
A set of static utility methods designed to keep the framework completely independent of any other framework except the standard Java libraries.
| Method Summary | |
static java.lang.String |
getBasenameOfClass(java.lang.Class clazz)
Retrieves the basename of a fully qualified class. |
static boolean |
getBoolean(java.lang.String s1)
Utility to convert a string to a boolean |
static java.lang.String |
getObjectIdentity(java.lang.Object obj)
Retrieves the JVM standard object identity as a String in the format {CLASS_NAME}@{SystemHashCode} |
static java.lang.String |
getPackageNameOfClass(java.lang.Class clazz)
Retrieves the package name of a fully qualified class. |
static java.lang.String |
getSystemIdentifer(java.lang.Object object)
Retrieve the Java standard system identifier string of an Object. |
static java.lang.String |
getSystemIdentiferShort(java.lang.Object object)
Retrieve the Java standard system identifier string of an Object, but show only the basename of the class Here is an example e.g SubstringFilterStrategy@1e8a1f6 |
static boolean |
hasAllAlphanumeric(java.lang.String s1)
Verify an input string contains only alphabetical or numerical characters in terms of unicode. |
static boolean |
hasAllDigits(java.lang.String s1)
Verify an input string contains all numerical (digit) characters |
static boolean |
hasAllLetters(java.lang.String s1)
Verify an input string contains all alphabetical characters in terms of unicode. |
static boolean |
isBlankOrNull(java.lang.String s1)
Return a boolean true if the input string
is empty or null. |
static java.lang.String |
join(java.util.Collection collection,
java.lang.String delimiter)
Joins a Java collection of strings with a delimiter to produce one single String |
static java.lang.String |
join(java.lang.String[] arr)
Joins an array of strings with a comma-space delimiter to produce one single String |
static java.lang.String |
join(java.lang.String[] arr,
java.lang.String delimiter)
Joins an array of strings with a delimiter to produce one single String |
static boolean |
matchArgument(java.lang.String ref,
java.lang.String arg)
A convenience static method for interpreting command line arguments with wildcard names. |
static java.lang.String |
notNull(java.lang.String s1)
Returns a String that is guaranteed not to be null. |
static byte |
parseStringToByte(java.lang.String input)
Converts a text input String to a primitive byte value
NB: If the value fails conversion the default value is zero. |
static byte |
parseStringToByte(java.lang.String input,
byte defaultValue)
Converts a text input String to a primitive byte value |
static double |
parseStringToDouble(java.lang.String input)
Converts a text input String to a primitive double value
NB: If the value fails conversion the default value is zero. |
static double |
parseStringToDouble(java.lang.String input,
double defaultValue)
Converts a text input String to a primitive double value |
static float |
parseStringToFloat(java.lang.String input)
Converts a text input String to a primitive float value
NB: If the value fails conversion the default value is zero. |
static float |
parseStringToFloat(java.lang.String input,
float defaultValue)
Converts a text input String to a primitive float value |
static int |
parseStringToInt(java.lang.String input)
Converts a text input String to a primitive int value
NB: If the value fails conversion the default value is zero. |
static int |
parseStringToInt(java.lang.String input,
int defaultValue)
Converts a text input String to a primitive int value |
static long |
parseStringToLong(java.lang.String input)
Converts a text input String to a primitive long value
NB: If the value fails conversion the default value is zero. |
static long |
parseStringToLong(java.lang.String input,
long defaultValue)
Converts a text input String to a primitive long value |
static short |
parseStringToShort(java.lang.String input)
Converts a text input String to a primitive short value
NB: If the value fails conversion the default value is zero. |
static short |
parseStringToShort(java.lang.String input,
short defaultValue)
Converts a text input String to a primitive short value |
static java.lang.String[] |
splice(java.lang.String input)
Break up a comma or semi-colon delimited input string into a constituent parts (an array of String) objects. |
static java.lang.String[] |
splice(java.lang.String input,
java.lang.String delimiters,
boolean trimElem)
Break up an input string to a constituent parts (an array of String) objects. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static java.lang.String notNull(java.lang.String s1)
null then a blank string is
returned, otherwise the supplied string is returned instead.
null stringpublic static boolean isBlankOrNull(java.lang.String s1)
true if the input string
is empty or null.
s1 - the input string
true the string is blank or nullpublic static boolean getBoolean(java.lang.String s1)
public static java.lang.String getObjectIdentity(java.lang.Object obj)
{CLASS_NAME}@{SystemHashCode}
public static boolean hasAllDigits(java.lang.String s1)
s1 - the input string
public static boolean hasAllLetters(java.lang.String s1)
s1 - the input string
public static boolean hasAllAlphanumeric(java.lang.String s1)
s1 - the input string
public static java.lang.String join(java.lang.String[] arr)
arr - the array of string
public static java.lang.String join(java.lang.String[] arr,
java.lang.String delimiter)
arr - the array of stringdelimiter - the delimiter string
public static java.lang.String join(java.util.Collection collection,
java.lang.String delimiter)
delimiter - the delimiter string
java.lang.ClassCastException - if an element in the supplied collection
is not a Stringpublic static java.lang.String[] splice(java.lang.String input)
input - the original input s1tring
splice(String, String, boolean)
public static java.lang.String[] splice(java.lang.String input,
java.lang.String delimiters,
boolean trimElem)
input - the original input stringdelimiters - the delimited characeterstrimElem - boolean value, true then each element gets an haircu
t and generally tidies up
public static boolean matchArgument(java.lang.String ref,
java.lang.String arg)
Given a reference string --desc*(ription), then
a matching command line argument is a member of the
following set:
--description --descriptio --descripti --descrip --descri --descr NB: The string matching takes place from right to left
ref - the reference argumentarg - the command line argument supplied to the program
true if there is a match
public static short parseStringToShort(java.lang.String input,
short defaultValue)
short value
input - the input text stringdefaultValue - the default value to use if the conversion fails
public static int parseStringToInt(java.lang.String input,
int defaultValue)
int value
input - the input text stringdefaultValue - the default value to use if the conversion fails
public static long parseStringToLong(java.lang.String input,
long defaultValue)
long value
input - the input text stringdefaultValue - the default value to use if the conversion fails
public static float parseStringToFloat(java.lang.String input,
float defaultValue)
float value
input - the input text stringdefaultValue - the default value to use if the conversion fails
public static double parseStringToDouble(java.lang.String input,
double defaultValue)
double value
input - the input text stringdefaultValue - the default value to use if the conversion fails
public static byte parseStringToByte(java.lang.String input,
byte defaultValue)
byte value
input - the input text stringdefaultValue - the default value to use if the conversion fails
public static short parseStringToShort(java.lang.String input)
short value
NB: If the value fails conversion the default value is zero.
input - the input text string
parseStringToShort(String, short)public static int parseStringToInt(java.lang.String input)
int value
NB: If the value fails conversion the default value is zero.
input - the input text string
parseStringToInt(String, int)public static long parseStringToLong(java.lang.String input)
long value
NB: If the value fails conversion the default value is zero.
input - the input text string
parseStringToLong(String, long)public static float parseStringToFloat(java.lang.String input)
float value
NB: If the value fails conversion the default value is zero.
input - the input text string
parseStringToFloat(String, float)public static double parseStringToDouble(java.lang.String input)
double value
NB: If the value fails conversion the default value is zero.
input - the input text string
parseStringToDouble(String, double)public static byte parseStringToByte(java.lang.String input)
byte value
NB: If the value fails conversion the default value is zero.
input - the input text string
parseStringToByte(String, byte)public static java.lang.String getBasenameOfClass(java.lang.Class clazz)
java.util.HashMap is just HashMap.
On the other hand, a class in the default package is just itself.
clazz - the class to retrieve the basename class from
public static java.lang.String getPackageNameOfClass(java.lang.Class clazz)
java.util.HashMap is just java.util.
On the other hand, a class in the default package is just ""
clazz - the class to retrieve the basename class from
public static java.lang.String getSystemIdentifer(java.lang.Object object)
com.csfb.csar.filter.strategy.SubstringFilterStrategy@1e8a1f6
object - the object
getSystemIdentifer(Object)public static java.lang.String getSystemIdentiferShort(java.lang.Object object)
SubstringFilterStrategy@1e8a1f6
object - the object
getBasenameOfClass(Class),
getSystemIdentifer(Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||