Class Utils


  • public class Utils
    extends java.lang.Object
    Utilities class
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String arrayToString​(java.lang.String[] in)
      String array to string converter.
      static java.lang.String collectionToString​(java.util.Collection<?> in)
      Collection to string converter.
      static boolean doubleEqual​(java.lang.Double v1, java.lang.Double v2)
      Checks if two doubles are equal.
      static boolean doubleEqual​(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.Field getFieldByName​(java.lang.Class<?> clazz, java.lang.String name)
      Gets field by name.
      static boolean isList​(java.lang.Class<?> clazz)
      Is list boolean.
      static boolean isMap​(java.lang.Class<?> clazz)
      Is map boolean.
      static boolean isScalarPrimitive​(java.lang.Class<?> clazz)
      Is class primitive boolean.
      static boolean isSubclassOf​(java.lang.Class<?> clazz, java.lang.Class<?> parentClass)
      Is subclass of boolean.
      static java.lang.String listToString​(java.util.List<?> in)
      List to string converter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 class
        name - 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 class
        parentClass - 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 double
        v2 - 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 double
        v2 - the second double
        precision - the precision of checking
        Returns:
        the boolean