Package com.priint.pubserver.comet.util
Class Utils
- java.lang.Object
-
- com.priint.pubserver.comet.util.Utils
-
public class Utils extends java.lang.ObjectUtilities class
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringarrayToString(java.lang.String[] in)String array to string converter.static java.lang.StringcollectionToString(java.util.Collection<?> in)Collection to string converter.static booleandoubleEqual(java.lang.Double v1, java.lang.Double v2)Checks if two doubles are equal.static booleandoubleEqual(java.lang.Double v1, java.lang.Double v2, java.lang.Double precision)Double equal boolean.static java.lang.reflect.Field[]getClassFields(java.lang.Class<?> clazz)Get class fields field [ ].static java.lang.reflect.Method[]getClassMethods(java.lang.Class<?> clazz)Get class methods as method [ ].static java.lang.reflect.FieldgetFieldByName(java.lang.Class<?> clazz, java.lang.String name)Gets field by name.static booleanisList(java.lang.Class<?> clazz)Is list boolean.static booleanisMap(java.lang.Class<?> clazz)Is map boolean.static booleanisScalarPrimitive(java.lang.Class<?> clazz)Is class primitive boolean.static booleanisSubclassOf(java.lang.Class<?> clazz, java.lang.Class<?> parentClass)Is subclass of boolean.static java.lang.StringlistToString(java.util.List<?> in)List to string converter.
-
-
-
Method Detail
-
getClassFields
public static java.lang.reflect.Field[] getClassFields(java.lang.Class<?> clazz)
Get class fields field [ ].- Parameters:
clazz- the class- Returns:
- the field [ ]
-
getClassMethods
public static java.lang.reflect.Method[] getClassMethods(java.lang.Class<?> clazz)
Get class methods as method [ ].- Parameters:
clazz- the clazz- Returns:
- the method [ ]
-
getFieldByName
public static java.lang.reflect.Field getFieldByName(java.lang.Class<?> clazz, java.lang.String name)Gets field by name.- Parameters:
clazz- the classname- the name of the field- Returns:
- the field by name
-
isList
public static boolean isList(java.lang.Class<?> clazz)
Is list boolean.- Parameters:
clazz- the class- Returns:
- the boolean
-
isMap
public static boolean isMap(java.lang.Class<?> clazz)
Is map boolean.- Parameters:
clazz- the class- Returns:
- the boolean
-
isSubclassOf
public static boolean isSubclassOf(java.lang.Class<?> clazz, java.lang.Class<?> parentClass)Is subclass of boolean.- Parameters:
clazz- the classparentClass- the parent class- Returns:
- the boolean
-
isScalarPrimitive
public static boolean isScalarPrimitive(java.lang.Class<?> clazz)
Is class primitive boolean.- Parameters:
clazz- the class- Returns:
- the boolean
-
arrayToString
public static final java.lang.String arrayToString(java.lang.String[] in)
String array to string converter.- Parameters:
in- the input- Returns:
- the string
-
listToString
public static final java.lang.String listToString(java.util.List<?> in)
List to string converter.- Parameters:
in- the input- Returns:
- the string
-
collectionToString
public static final java.lang.String collectionToString(java.util.Collection<?> in)
Collection to string converter.- Parameters:
in- the input- Returns:
- the string
-
doubleEqual
public static final boolean doubleEqual(java.lang.Double v1, java.lang.Double v2)Checks if two doubles are equal.- Parameters:
v1- the first doublev2- the second double- Returns:
- the boolean
-
doubleEqual
public static final boolean doubleEqual(java.lang.Double v1, java.lang.Double v2, java.lang.Double precision)Double equal boolean.- Parameters:
v1- the first doublev2- the second doubleprecision- the precision of checking- Returns:
- the boolean
-
-