public class TypeTool extends Object
| Constructor and Description |
|---|
TypeTool() |
| Modifier and Type | Method and Description |
|---|---|
static String |
addRoleNamePrefix(String attributeName,
String roleName)
Adds the specified roleName as prefix to the attribute name.
|
static String |
asBeanBooleanGetter(String fieldName)
Construct a JavaBean style getter method name from the given field name, boolean "is" style.
|
static String |
asBeanGetter(String fieldName)
Construct a JavaBean style getter method name from the given field name.
|
static String |
asBeanSetter(String fieldName)
Construct a JavaBean style setter method name from the given field name.
|
static void |
breakpoint()
Deprecated.
Since 8.2.1.b
|
static int |
compareTo(boolean a,
boolean b)
Regular compare to.
|
static int |
compareTo(char a,
char b)
Regular compare to.
|
static int |
compareTo(double a,
double b)
Regular compare to.
|
static int |
compareTo(float a,
float b)
Regular compare to.
|
static int |
compareTo(int a,
int b)
Regular compare to.
|
static int |
compareTo(long a,
long b)
Regular compare to.
|
static int |
compareTo(Object a,
Object b)
null safe compareTo.
|
static Boolean |
convert(boolean b)
Converts a boolean to a Boolean
|
static boolean |
convert(boolean data,
boolean field)
Converts a boolean into a boolean.
|
static byte |
convert(byte data,
byte field)
Converts a byte into a byte.
|
static Character |
convert(char primitive)
Converts a char to a Character
|
static Date |
convert(Date data,
Date field)
Converts a Date into a Date.
|
static Object |
convert(double primitive)
Converts a double to a Double
|
static Object |
convert(float primitive)
Converts a float to a Float
|
static String |
convert(G9Enumerator n)
BUGGY? Converts the specified enumerator to a string represenatation of
the current value.
|
static Object |
convert(int primitive)
Converts an int to an Integer, or "" if it is 0
|
static int |
convert(int data,
int field)
Converts a int into an int.
|
static Object |
convert(long primitive)
Converts a long to a Long
|
static String |
convert(Numeric n)
Converts the specified numeric to it's string representation.
|
static Object |
convert(Object o)
If a null object is converted, an empty string is returned
|
static Object |
convert(short primitive)
Converts a short to a Short
|
static boolean |
convert(String data,
boolean field)
Converts a String into a boolean.
|
static byte |
convert(String data,
byte field)
Converts a String into a byte.
|
static char |
convert(String data,
char field)
Converts a String into a char.
|
static Date |
convert(String data,
Date field)
Converts a String into a Date.
|
static double |
convert(String data,
double field)
Converts a String into a double.
|
static float |
convert(String data,
float field)
Converts a String into a float.
|
static G9Enumerator |
convert(String data,
G9Enumerator field)
Converts the string to a G9 Enumerator.
|
static int |
convert(String data,
int field)
Converts a String into an int.
|
static long |
convert(String data,
long field)
Converts a String into a long.
|
static Numeric |
convert(String data,
Numeric field)
Converts a String into a Numeric.
|
static short |
convert(String data,
short field)
Converts a String into a short.
|
static String |
convert(String data,
String field)
Converts a String into a String.
|
static Date |
convert(String day,
String month,
String year,
Date d)
Converts the specifed day, month and year to a date.
|
static Boolean |
convertIgnore(boolean primitive,
boolean ignoreZero)
Convert the primitive.
|
static Character |
convertIgnore(char primitive,
boolean ignoreZero)
Convert the primitive.
|
static Object |
convertIgnore(double primitive,
boolean ignoreZero)
Convert the primitive.
|
static Object |
convertIgnore(float primitive,
boolean ignoreZero)
Convert the primitive.
|
static String |
convertIgnore(G9Enumerator n,
boolean ignoreZero)
BUGGY.
|
static Object |
convertIgnore(int primitive,
boolean ignoreZero)
Convert the primitive.
|
static Object |
convertIgnore(long primitive,
boolean ignoreZero)
Convert the primitive.
|
static String |
convertIgnore(Numeric n,
boolean ignoreZero)
Converts a numeric to it's string representation.
|
static Object |
convertIgnore(Object o,
boolean ignoreZero)
If a null object is converted, an empty string is returned
|
static Object |
convertIgnore(short primitive,
boolean ignoreZero)
Convert the primitive.
|
static boolean |
convertTobool(boolean b)
Converts a boolean to a boolean.
|
static boolean |
convertTobool(Boolean b)
Converts a Boolean to a boolean.
|
static Date |
convertToDate(String data)
Converts the specified string to a date
|
static int |
convertToInt(G9Enumerator arg)
Converts the specified argument to an int.
|
static int |
convertToInt(int n)
Dummy method - returns the specified int
|
static int |
convertToInt(Numeric arg)
Converts the specified argument to an int.
|
static int |
convertToInt(String arg)
Converts the specified argument to an int.
|
static String |
convertToString(boolean b)
Converts a boolean to a String.
|
static String |
convertToString(boolean b,
boolean ignoreZero)
Converts a boolean to a String.
|
static String |
convertToString(char c)
Converts a char to a String.
|
static String |
convertToString(char c,
boolean ignoreZero)
Converts a char to a String.
|
static String |
convertToString(double d)
Converts a double to a String.
|
static String |
convertToString(double d,
boolean ignoreZero)
Converts a double to a String.
|
static String |
convertToString(float f)
Converts a float to a String.
|
static String |
convertToString(float f,
boolean ignoreZero)
Converts a float to a String.
|
static String |
convertToString(int i)
Converts an int to a String.
|
static String |
convertToString(int i,
boolean ignoreZero)
Converts an int to a String.
|
static String |
convertToString(long l)
Converts a long to a String.
|
static String |
convertToString(long l,
boolean ignoreZero)
Converts a long to a String.
|
static String |
convertToString(Object o)
Converts an Object to String using toString().
|
static String |
convertToString(Object ob,
boolean ignoreZero)
Converts an Object to String using toString().
|
static boolean |
differ(Object value1,
Object value2)
Check if the two value differs.
|
static List |
disjunctList(List fromLista,
List fromListb,
G9Comparator objComp)
Deprecated.
Since 8.2.1.b
|
static List |
disjunctListBinary(List fromLista,
List fromListb,
G9Comparator objComp)
Deprecated.
Since 8.2.1.b
|
static boolean |
equals(boolean a,
boolean b)
Regular equals.
|
static boolean |
equals(double a,
double b)
Regular equals.
|
static boolean |
equals(long a,
long b)
Regular equals.
|
static boolean |
equals(Object a,
Object b)
Null safe equals.
|
static String |
getAttributeClassName(Object owner,
String field)
Returns the attribute class name
|
static String |
getAttributeClassNameMethod(Object owner,
String field)
REturns the getter method name for the specified field
|
static <E> Collection<E> |
getDefaultCollection()
Returns a new instance of the default collection type.
|
static Class<? extends Collection> |
getDefaultCollectionType()
Returns the class object representing the default collection type.
|
static <E> List<E> |
getDefaultList()
Returns a new instance of the default list type.
|
static Class<? extends List> |
getDefaultListType()
Returns the class object representing the default list type.
|
static <K,V> Map<K,V> |
getDefaultMap()
Returns a new instance of the default map type.
|
static Class<? extends Map> |
getDefaultMapType()
Returns the class object representing the default map type.
|
static <E> Set<E> |
getDefaultSet()
Returns a new instance of the default set type.
|
static Class<? extends Set> |
getDefaultSetType()
Returns the class object representing the default set type.
|
static String |
getRoleNamePrefix(String roleAttributeName)
Returns the role name prefix of the specified String.
|
static boolean |
hasValue(boolean primitive)
Check that the specified primitive is not zero (always true for boolean)
|
static boolean |
hasValue(byte primitive)
Check that the specified primitive is not zero.
|
static boolean |
hasValue(char primitive)
Check that the specified primitive is not zero.
|
static boolean |
hasValue(Date d)
Checks if the date field is assigned to a Date object.
|
static boolean |
hasValue(double primitive)
Check that the specified primitive is not zero.
|
static boolean |
hasValue(float primitive)
Check that the specified primitive is not zero.
|
static boolean |
hasValue(G9Enumerator e)
Returns true if the G9Enumeator is not null and has a different value
than 0.
|
static boolean |
hasValue(int primitive)
Check that the specified primitive is not zero.
|
static boolean |
hasValue(long primitive)
Check that the specified primitive is not zero.
|
static boolean |
hasValue(Numeric n)
Checks if the Numeric field is assigned to a Numeric object.
|
static boolean |
hasValue(short primitive)
Check that the specified primitive is not zero.
|
static boolean |
hasValue(String t)
Returns true if the string is not null and not empty.
|
static boolean |
isBoolean(boolean x)
Check if the specified primitive is a boolean.
|
static boolean |
isBoolean(char x)
Check if the specified primitive is a boolean.
|
static boolean |
isBoolean(Date x)
Check if the specified date is a boolean.
|
static boolean |
isBoolean(double x)
Check if the specified primitive is a boolean.
|
static boolean |
isBoolean(float x)
Check if the specified primitive is a boolean.
|
static boolean |
isBoolean(int x)
Check if the specified primitive is a boolean.
|
static boolean |
isBoolean(long x)
Check if the specified primitive is a boolean.
|
static boolean |
isBoolean(Object x)
Check if the specified object is a boolean.
|
static boolean |
isBoolean(String x)
Check if the specified primitive is a boolean.
|
static boolean |
isConsistant(String t,
boolean i)
Dummy method.
|
static boolean |
isConsistant(String t,
byte i)
Dummy method.
|
static boolean |
isConsistant(String t,
char i)
Dummy method.
|
static boolean |
isConsistant(String t,
Date d)
Check if the specified string represents a valid date.
|
static boolean |
isConsistant(String t,
double i)
Dummy method.
|
static boolean |
isConsistant(String t,
float i)
Dummy method.
|
static boolean |
isConsistant(String t,
int i)
Dummy method.
|
static boolean |
isConsistant(String t,
Object o)
Dummy method.
|
static boolean |
isEmpty(String s)
Convenience method, checks if the specified String is either empty (""),
or consists entirely of blanks (" "), or is a null-pointer, in which case
it returns
true |
static boolean |
isEnumerator(boolean a,
String field)
Dummy method.
|
static boolean |
isEnumerator(byte a,
String field)
Dummy method.
|
static boolean |
isEnumerator(char a,
String field)
Dummy method.
|
static boolean |
isEnumerator(float a,
String field)
Dummy method.
|
static boolean |
isEnumerator(int a,
String field)
Dummy method.
|
static boolean |
isEnumerator(long a,
String field)
Dummy method.
|
static boolean |
isEnumerator(Object owner,
String field)
Check if the
owner is an enumerator. |
static boolean |
isEnumeratorMethod(boolean a,
String field)
Dummy method, checks if the specified field is an enumerator.
|
static boolean |
isEnumeratorMethod(char a,
String field)
Dummy method, checks if the specified field is an enumerator.
|
static boolean |
isEnumeratorMethod(int a,
String field)
Dummy method, checks if the specified field is an enumerator.
|
static boolean |
isEnumeratorMethod(Object owner,
String field)
Check if the field is an enumerator
|
static boolean |
isVmVersion(String version)
Check the java version.
|
static boolean |
isVmVersion1_4()
Check if java vm version is 1.4
|
static String |
leadingZeroes(int intToConvert,
int length)
Deprecated.
Since 8.2.1b. Use java.text.DecimalFormat instead
|
static Date |
parse(String arg)
Parses the string to a Date
|
static Map<String,String> |
quickIndex(String[] tabSequence,
boolean next)
Returns the tab sequence map
|
static void |
reflectAssign(Object to,
String field,
String value)
Performs assing using retrospection on field 'field' of type class
'fieldClassName' in object 'to', with the value 'value'
|
static void |
reflectAssignMethod(Object to,
String field,
String value)
Assigns the specified value using reflection.
|
static void |
reflectCopy(Object from,
String field,
Object to)
Copies the specified attribute from the
from object to the
to object. |
static void |
reflectCopyMethod(Object from,
String field,
Object to)
This method uses reflection to copy the field "field" from object "from"
to object "to".
|
static <E> Set<E> |
reHash(Set<E> serializedSet)
Creates a new set, and adds all instances contained in the specified set
to the new set.
|
static String |
replace(String str,
String o,
String n,
boolean all)
Replaces a string with a string in a string.
|
static boolean |
safeCopy(boolean field)
Used to make sure that a field is safely copied.
|
static byte |
safeCopy(byte field)
Used to make sure that a field is safely copied.
|
static char |
safeCopy(char field)
Used to make sure that a field is safely copied.
|
static Date |
safeCopy(Date field)
Used to make sure that a field is safely copied.
|
static double |
safeCopy(double field)
Used to make sure that a field is safely copied.
|
static float |
safeCopy(float field)
Used to make sure that a field is safely copied.
|
static G9Enumerator |
safeCopy(G9Enumerator field)
Used to make sure that a field is safely copied.
|
static int |
safeCopy(int field)
Used to make sure that a field is safely copied.
|
static long |
safeCopy(long field)
Used to make sure that a field is safely copied.
|
static Numeric |
safeCopy(Numeric field)
Used to make sure that a field is safely copied.
|
static short |
safeCopy(short field)
Used to make sure that a field is safely copied.
|
static String |
safeCopy(String field)
Used to make sure that a field is safely copied.
|
static void |
setDefaultCollection(Collection<?> collection)
Sets the default collection type to be of the same type as
collection |
static void |
setDefaultCollectionType(Class<? extends Collection> collectionType)
Sets the default type for collection.
|
static void |
setDefaultList(List<?> list)
Sets the default list type to be of the same type as
list |
static void |
setDefaultListType(Class<? extends List> listType)
Sets the default type for list.
|
static void |
setDefaultMap(Map<?,?> map)
Sets the default map type to be of the same type as
map |
static void |
setDefaultMapType(Class<? extends Map> mapType)
Sets the default type for map.
|
static void |
setDefaultSet(Set<?> set)
Sets the default set type to be of the same type as
set |
static void |
setDefaultSetType(Class<? extends Set> setType)
Sets the default type for set.
|
static String |
stripEnd(String str)
Strip trailing whitespace from end of string.
|
static String |
stripRoleNamePrefix(String attr,
String roleName)
Removes the specified role name prefix from the supplied attribute
string.
|
static String |
superDateFormat(String d)
Formats the specified string according to CustomDate.superDateFormat.
|
static Object |
toObject(boolean b)
Convert a primary type to wrapper type.
|
static Object |
toObject(byte b)
Convert a primary type to wrapper type.
|
static Object |
toObject(char c)
Convert a primary type to wrapper type.
|
static Object |
toObject(double d)
Convert a primary type to wrapper type.
|
static Object |
toObject(float f)
Convert a primary type to wrapper type.
|
static Object |
toObject(int i)
Convert a primary type to wrapper type.
|
static Object |
toObject(long l)
Convert a primary type to wrapper type.
|
static Object |
toObject(Object o)
Just return the object...
|
static Object |
toObject(short s)
Convert a primary type to wrapper type.
|
static List |
unionLists(List fromLista,
List fromListb,
G9Comparator objComp)
Deprecated.
Since 8.2.1.b
|
static List |
uniqueList(List l,
G9Comparator comp)
Deprecated.
Since 8.2.1.b
|
static boolean |
viewFieldDiffer(Object fieldValue1,
Object fieldValue2)
Check if the two field values differs.
|
public static final Class<? extends Map> getDefaultMapType()
public static final void setDefaultMapType(Class<? extends Map> mapType)
getDefaultMap returns instances of mapTypemapType - class implementing the Map interface.public static final <K,V> Map<K,V> getDefaultMap()
K - Key type for returned mapV - Valie type for returned mappublic static final void setDefaultMap(Map<?,?> map)
mapmap - object representing the (new) default map type.public static final Class<? extends Set> getDefaultSetType()
public static final void setDefaultSetType(Class<? extends Set> setType)
getDefaultSet returns instances of setTypesetType - class implementing the Set interface.public static final <E> Set<E> getDefaultSet()
E - Element type for the Setpublic static <E> Set<E> reHash(Set<E> serializedSet)
E - Type of set elementsserializedSet - the set to be re-hashed.public static final void setDefaultSet(Set<?> set)
setset - object representing the (new) default set type.public static final Class<? extends List> getDefaultListType()
public static final void setDefaultListType(Class<? extends List> listType)
getDefaultList returns instances of listTypelistType - class implementing the List interface.public static final <E> List<E> getDefaultList()
E - Element type for Listpublic static final void setDefaultList(List<?> list)
listlist - object representing the (new) default list type.public static final Class<? extends Collection> getDefaultCollectionType()
public static final void setDefaultCollectionType(Class<? extends Collection> collectionType)
getDefaultCollection returns instances of
collectionTypecollectionType - class implementing the Collection interface.public static final <E> Collection<E> getDefaultCollection()
E - Element type for Collectionpublic static final void setDefaultCollection(Collection<?> collection)
collectioncollection - object representing the (new) default map type.public static final boolean isVmVersion(String version)
version - (missing javadoc)public static final boolean isVmVersion1_4()
@Deprecated public static String leadingZeroes(int intToConvert, int length)
intToConvert - the int to prefix with leading zeroes.length - the length of the text (including leading zeroes)public static void reflectCopyMethod(Object from, String field, Object to)
from - the object to copy fromfield - the attribute to copyto - the object to copy topublic static String replace(String str, String o, String n, boolean all)
str - The original string.o - The string to replace.n - The string to change to.all - true if all occurrences should be changed, false if just the
first.@Deprecated public static List disjunctListBinary(List fromLista, List fromListb, G9Comparator objComp)
fromLista - list of candidates to returnfromListb - the list of elements to not returnobjComp - the comparatorfromListapublic static void reflectCopy(Object from, String field, Object to)
from object to the
to object.from - the object to copy fromfield - the field to copyto - the object to copy to.public static Map<String,String> quickIndex(String[] tabSequence, boolean next)
tabSequence - array of tab sequencenext - boolean flag@Deprecated public static List disjunctList(List fromLista, List fromListb, G9Comparator objComp)
fromLista - the list containing all elementsfromListb - the list containing the elements that will be removedobjComp - the comparatorfromLista
list.@Deprecated public static List unionLists(List fromLista, List fromListb, G9Comparator objComp)
fromLista - a listfromListb - a listobjComp - the comparatorpublic static void reflectAssignMethod(Object to, String field, String value)
to - The object to assign the value to.field - The attribute to assign to.value - The value to assign.public static void reflectAssign(Object to, String field, String value)
to - The object to assign tofield - The attribute to assign tovalue - The value to assign.public static String getAttributeClassNameMethod(Object owner, String field)
owner - the object with the fieldfield - the attributepublic static String getAttributeClassName(Object owner, String field)
owner - the object with the attributefield - the name of the attributepublic static Object convertIgnore(int primitive, boolean ignoreZero)
primitive - the primitive to wrapignoreZero - if true zero values will converted to the
empty string.public static Object convert(int primitive)
primitive - the primitive to convert.public static Object convertIgnore(short primitive, boolean ignoreZero)
primitive - the primitive to wrapignoreZero - if true zero values will converted to the
empty string.public static Object convert(short primitive)
primitive - the primitive to convert.public static Object convertIgnore(long primitive, boolean ignoreZero)
primitive - the primitive to wrapignoreZero - if true zero values will converted to the
empty string.public static Object convert(long primitive)
primitive - the primitive to convert.public static Object convertIgnore(double primitive, boolean ignoreZero)
primitive - the primitive to wrapignoreZero - if true zero values will converted to the
empty string.public static Object convert(double primitive)
primitive - the primitive to convert.public static Object convertIgnore(float primitive, boolean ignoreZero)
primitive - the primitive to wrapignoreZero - if true zero values will converted to the
empty string.public static Object convert(float primitive)
primitive - the primitive to convert.public static Boolean convertIgnore(boolean primitive, boolean ignoreZero)
primitive - the primitive to wrapignoreZero - if true zero values will converted to the
empty string.public static Boolean convert(boolean b)
b - the boolean to convertpublic static Character convertIgnore(char primitive, boolean ignoreZero)
primitive - the primitive to wrapignoreZero - if true zero values will converted to the
empty string.public static Character convert(char primitive)
primitive - the primitive to convert.public static String convertIgnore(Numeric n, boolean ignoreZero)
n - the numeric to convertignoreZero - boolean flag indicating if zero should be ignored.public static String convert(Numeric n)
n - the numeric to convertpublic static String convertIgnore(G9Enumerator n, boolean ignoreZero)
n - the enumerator to convertignoreZero - the ignore zero flag.public static String convert(G9Enumerator n)
n - the enumerator to convertpublic static Object convertIgnore(Object o, boolean ignoreZero)
o - the object to convertignoreZero - the ignore zero flagpublic static Object convert(Object o)
o - the object to convertpublic static Date parse(String arg)
arg - the string to parsepublic static Date convert(String day, String month, String year, Date d)
day - the daymonth - the monthyear - the yeard - this parameter is not used any more.public static byte convert(String data, byte field)
data - The String to be converted.field - Field used to control which convert method is to be called.public static byte convert(byte data,
byte field)
data - The byte to be converted.field - Field used to control which convert method is to be called.public static short convert(String data, short field)
data - The String to be converted.field - Field used to control which convert method is to be called.public static int convert(String data, int field)
data - The String to be converted.field - Field used to control which convert method is to be called.public static int convert(int data,
int field)
data - The int to be converted.field - Field used to control which convert method is to be called.public static boolean convert(String data, boolean field)
data - The String to be converted.field - Field used to control which convert method is to be called.public static boolean convert(boolean data,
boolean field)
data - The boolean to be copied.field - Field used to control which convert method is to be called.public static String convert(String data, String field)
data - The String to be converted.field - Field used to control which convert method is to be called.public static char convert(String data, char field)
data - The String to be converted.field - Field used to control which convert method is to be called.public static float convert(String data, float field)
data - The String to be converted.field - Field used to control which convert method is to be called.public static double convert(String data, double field)
data - The String to be converted.field - Field used to control which convert method is to be called.public static long convert(String data, long field)
data - The String to be converted.field - Field used to control which convert method is to be called.public static Date convert(String data, Date field)
data - The String to be converted.field - Field used to control which convert method is to be called.Datepublic static Date convertToDate(String data)
data - the string datepublic static Date convert(Date data, Date field)
data - The Date to be returned. (No copy here)field - Field used to control which convert method is to be called.public static Numeric convert(String data, Numeric field)
data - The String to be converted.field - Field used to control which convert method is to be called.public static G9Enumerator convert(String data, G9Enumerator field)
data - the current value (an int as string)field - the enumerator.public static String convertToString(Object ob, boolean ignoreZero)
ob - the object to convertignoreZero - the ignoreZero flag (not used by this method)public static String convertToString(Object o)
o - the object to convertpublic static String convertToString(int i, boolean ignoreZero)
i - The primitive to convertignoreZero - The ignore zero flagpublic static String convertToString(int i)
i - The primitive to convertpublic static String convertToString(boolean b)
b - The primitive to convertpublic static String convertToString(boolean b, boolean ignoreZero)
b - The primitive to convertignoreZero - The ignore zero flagpublic static String convertToString(char c)
c - The primitive to convertpublic static String convertToString(char c, boolean ignoreZero)
c - The primitive to convertignoreZero - The ignore zero flagpublic static String convertToString(float f)
f - The primitive to convertpublic static String convertToString(float f, boolean ignoreZero)
f - The primitive to convertignoreZero - The ignore zero flagpublic static String convertToString(double d)
d - The primitive to convertpublic static String convertToString(double d, boolean ignoreZero)
d - The primitive to convertignoreZero - The ignore zero flagpublic static String convertToString(long l)
l - The primitive to convertpublic static String convertToString(long l, boolean ignoreZero)
l - The primitive to convertignoreZero - The ignore zero flagpublic static boolean convertTobool(Boolean b)
b - An Boolean objectpublic static boolean convertTobool(boolean b)
b - An booleanpublic static int convertToInt(int n)
n - the int to convertpublic static int convertToInt(String arg)
arg - the argument to convert to an intpublic static int convertToInt(G9Enumerator arg)
arg - the argument to convert to an intpublic static int convertToInt(Numeric arg)
arg - the argument to convert to an intpublic static byte safeCopy(byte field)
field - the value to copysafeCopy(String f)public static boolean safeCopy(boolean field)
field - the value to copysafeCopy(String f)public static char safeCopy(char field)
field - the value to copysafeCopy(String f)public static short safeCopy(short field)
field - the value to copysafeCopy(String f)public static int safeCopy(int field)
field - the value to copysafeCopy(String f)public static long safeCopy(long field)
field - the value to copysafeCopy(String f)public static float safeCopy(float field)
field - the value to copysafeCopy(String f)public static double safeCopy(double field)
field - the value to copysafeCopy(String f)public static String safeCopy(String field)
field - the value to copysafeCopy(String f)public static Date safeCopy(Date field)
field - the value to copysafeCopy(String f)public static G9Enumerator safeCopy(G9Enumerator field)
field - the value to copysafeCopy(String f)public static Numeric safeCopy(Numeric field)
field - the value to copy@Deprecated public static void breakpoint()
public static boolean equals(long a,
long b)
a - the first number to compareb - the second number to comparepublic static boolean equals(double a,
double b)
a - the first number to compareb - the second number to comparepublic static boolean equals(boolean a,
boolean b)
a - the first boolean to compareb - the second boolean to comparepublic static boolean equals(Object a, Object b)
if (a == null && b == null) {
return true;
} else {
return a != null && a.equals(b);
}
a - the first object to compareb - the second object to comparepublic static int compareTo(int a,
int b)
a - Ab - Bpublic static int compareTo(boolean a,
boolean b)
a - Ab - Bpublic static int compareTo(long a,
long b)
a - Ab - Bpublic static int compareTo(char a,
char b)
a - Ab - Bpublic static int compareTo(float a,
float b)
a - Ab - Bpublic static int compareTo(double a,
double b)
a - Ab - Bpublic static int compareTo(Object a, Object b)
a - Ab - Bpublic static boolean isEnumeratorMethod(Object owner, String field)
owner - the object with the fieldfield - the name of the fieldtrue if the field is an enumerator.public static boolean isEnumeratorMethod(int a,
String field)
a - ignoredfield - ignoredpublic static boolean isEnumeratorMethod(boolean a,
String field)
a - ignoredfield - ignoredpublic static boolean isEnumeratorMethod(char a,
String field)
a - ignoredfield - ignoredpublic static boolean isEnumerator(Object owner, String field)
owner is an enumerator.owner - the object to checkfield - ignoredtrue if owner is an instance of
G9Enumerator.public static boolean isEnumerator(int a,
String field)
a - ignored.field - ignored.public static boolean isEnumerator(boolean a,
String field)
a - ignored.field - ignored.public static boolean isEnumerator(long a,
String field)
a - ignored.field - ignored.public static boolean isEnumerator(float a,
String field)
a - ignored.field - ignored.public static boolean isEnumerator(char a,
String field)
a - ignored.field - ignored.public static boolean isEnumerator(byte a,
String field)
a - ignored.field - ignored.public static boolean isConsistant(String t, int i)
truet - ignored.i - ignoredpublic static boolean isConsistant(String t, float i)
truet - ignored.i - ignoredpublic static boolean isConsistant(String t, double i)
truet - ignored.i - ignoredpublic static boolean isConsistant(String t, byte i)
truet - ignored.i - ignoredpublic static boolean isConsistant(String t, char i)
truet - ignored.i - ignoredpublic static boolean isConsistant(String t, boolean i)
truet - ignored.i - ignoredpublic static boolean isConsistant(String t, Date d)
t - a string representation of a dated - a datetrue if t can be parsed to a date.public static boolean isConsistant(String t, Object o)
t - ingored.o - ignored.public static boolean isBoolean(boolean x)
x - the primitive to checkpublic static boolean isBoolean(double x)
x - the primitive to checkpublic static boolean isBoolean(String x)
x - the primitive to checkpublic static boolean isBoolean(int x)
x - the primitive to checkpublic static boolean isBoolean(float x)
x - the primitive to checkpublic static boolean isBoolean(long x)
x - the primitive to checkpublic static boolean isBoolean(Date x)
x - the date to checkpublic static boolean isBoolean(char x)
x - the primitive to checkpublic static boolean isBoolean(Object x)
x - the object to checkpublic static boolean hasValue(String t)
t - the string to checktrue if the string is not null or empty.public static boolean hasValue(Date d)
d - the date to checktrue if the date is not null.public static boolean hasValue(Numeric n)
n - the numeric to checktrue if the numeric is not null and not zero.public static boolean hasValue(G9Enumerator e)
e - the enumerator to checktrue if not null and not zero.public static boolean hasValue(int primitive)
primitive - the primitive to checktrue if the primitive is not zero.public static boolean hasValue(boolean primitive)
primitive - the primitive to checktrue.public static boolean hasValue(float primitive)
primitive - the primitive to checktrue if the primitive is not zero.public static boolean hasValue(double primitive)
primitive - the primitive to checktrue if the primitive is not zero.public static boolean hasValue(long primitive)
primitive - the primitive to checktrue if the primitive is not zero.public static boolean hasValue(char primitive)
primitive - the primitive to checktrue if the primitive is not zero.public static boolean hasValue(short primitive)
primitive - the primitive to checktrue if the primitive is not zero.public static boolean hasValue(byte primitive)
primitive - the primitive to checktrue if the primitive is not zero.@Deprecated public static List uniqueList(List l, G9Comparator comp)
l - the list of elementscomp - the comparator specifying when elements are equal.public static String superDateFormat(String d)
d - the string to formatpublic static Object toObject(int i)
i - (missing javadoc)public static Object toObject(long l)
l - (missing javadoc)public static Object toObject(byte b)
b - (missing javadoc)public static Object toObject(short s)
s - (missing javadoc)public static Object toObject(boolean b)
b - (missing javadoc)public static Object toObject(double d)
d - (missing javadoc)public static Object toObject(float f)
f - (missing javadoc)public static Object toObject(char c)
c - (missing javadoc)public static Object toObject(Object o)
o - (missing javadoc)public static String asBeanGetter(String fieldName)
fieldName - (missing javadoc)public static String asBeanBooleanGetter(String fieldName)
fieldName - (missing javadoc)public static String asBeanSetter(String fieldName)
fieldName - (missing javadoc)public static boolean isEmpty(String s)
trues - the string to checktrue if the string is either empty or
nullpublic static String stripEnd(String str)
str - input stringpublic static String getRoleNamePrefix(String roleAttributeName)
roleAttributeName contais a '.', the substring from index 0
to the index of the '.' is returned. Otherwise the returned value is
null.
Examples: getRoleNamePrefix("foo.bar"); returns "foo".
getRoleNamePrefix("foobar"); returns null.
getRoleNamePrefix(".bar"); returns "".
roleAttributeName - the string specifying an attribute and possibly
a role name.public static String stripRoleNamePrefix(String attr, String roleName)
attr
string starts with the string and the first character after the string is
a '.'. Thus stripRoleNamePrefix("foo.bar", "foo") returns
"bar" stripRoleNamePrefix("foox.bar", "foo" returns
"foox.bar"attr - the string with attribute name and possibly a role nameroleName - the role name to strip from the attr stringpublic static String addRoleNamePrefix(String attributeName, String roleName)
attributeName - the name of the attribute.roleName - the name of the role.public static final boolean differ(Object value1, Object value2)
value1 - the first value to comparevalue2 - the second value to comparetrue if the values differ.public static final boolean viewFieldDiffer(Object fieldValue1, Object fieldValue2)
differ(Object, Object), but with special treatment of Strings:
Trailing blanks are ignored, and an empty string is considered
equal to a null string.fieldValue1 - the first value to comparefieldValue2 - the second value to comparetrue if the values differ.Copyright © 2006–2018 Esito AS. All rights reserved.