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