Package net.ontopia.topicmaps.db2tm
Class Functions
java.lang.Object
net.ontopia.topicmaps.db2tm.Functions
INTERNAL: A collection of DB2TM functions intended to be used in
the function-column element.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringINTERNAL: Returns the string argument as-is.static StringINTERNAL: Returns the first non-null argument.static StringINTERNAL: Returns the first non-null argument.static StringcoalesceThen(String str1, String then1) INTERNAL: Same as coalesce, but will return then-argument instead of the checked value.static StringcoalesceThen(String str1, String then1, String str2, String then2) INTERNAL: Same as coalesce, but will return then-argument instead of the checked value.static StringconvertDate(String date, String informat, String outformat) INTERNAL: Conversion between two date formats.static StringfailIfEmpty(String str, String message) INTERNAL: Function will throw an exception with the given message if the string value is null or empty.static StringifEmptyThenElse(String str, String thenval, String elseval) INTERNAL: Checks to see that the string is null or empty.static StringifEqualThenElse(String str1, String str2, String thenval, String elseval) INTERNAL: Compares the first two arguments.static StringINTERNAL: Turn a string into a suffix suitable for a PSI.static StringstringReplaceAll(String str, String regex, String toValue) INTERNAL: Replace all occurrences of a regex in a string with a new value.static StringstripSpaces(String str) INTERNAL: Returns the string minus all spaces.static StringINTERNAL: Returns a substring of the given String.static StringtoLowerCase(String str) INTERNAL: Lowercases the given String.static StringtoUpperCase(String str) INTERNAL: Uppercases the given String.static StringINTERNAL: Trims the given String.static StringuseFirstIfDifferent(String str1, String str2) INTERNAL: Returns the first argument if the two arguments are different.static StringuseFirstIfEqual(String str1, String str2) INTERNAL: Returns the first argument if the two arguments are equal.
-
Constructor Details
-
Functions
public Functions()
-
-
Method Details
-
asIs
INTERNAL: Returns the string argument as-is. This is useful because parameters can be constructed as patterns. -
toUpperCase
INTERNAL: Uppercases the given String. If the parameter is null it returns null. -
toLowerCase
INTERNAL: Lowercases the given String. If the parameter is null it returns null. -
trim
INTERNAL: Trims the given String. If the parameter is null it returns null. -
substring
public static String substring(String str, String beginIndex, String endIndex) throws NumberFormatException INTERNAL: Returns a substring of the given String.- Throws:
NumberFormatException
-
ifEqualThenElse
INTERNAL: Compares the first two arguments. If they are equal the third argument is returned, if not the fourth one is. -
ifEmptyThenElse
INTERNAL: Checks to see that the string is null or empty. If it is then the then value is returned, otherwise the else value. -
useFirstIfDifferent
INTERNAL: Returns the first argument if the two arguments are different. If they are equal null is returned. -
useFirstIfEqual
INTERNAL: Returns the first argument if the two arguments are equal. If they are different null is returned. -
coalesce
INTERNAL: Returns the first non-null argument. -
coalesce
INTERNAL: Returns the first non-null argument. -
coalesceThen
INTERNAL: Same as coalesce, but will return then-argument instead of the checked value. Will return null if none of the checked values are non-empty. -
coalesceThen
INTERNAL: Same as coalesce, but will return then-argument instead of the checked value. Will return null if none of the checked values are non-empty. -
failIfEmpty
INTERNAL: Function will throw an exception with the given message if the string value is null or empty. -
convertDate
INTERNAL: Conversion between two date formats.- See Also:
-