Class Utils

java.lang.Object
com.priint.pubserver.comet.util.Utils

public class Utils extends Object
Utilities class
  • Method Details

    • getClassFields

      public static Field[] getClassFields(Class<?> clazz)
      Get class fields field [ ].
      Parameters:
      clazz - the class
      Returns:
      the field [ ]
    • getClassMethods

      public static Method[] getClassMethods(Class<?> clazz)
      Get class methods as method [ ].
      Parameters:
      clazz - the clazz
      Returns:
      the method [ ]
    • getFieldByName

      public static Field getFieldByName(Class<?> clazz, 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(Class<?> clazz)
      Is list boolean.
      Parameters:
      clazz - the class
      Returns:
      the boolean
    • isMap

      public static boolean isMap(Class<?> clazz)
      Is map boolean.
      Parameters:
      clazz - the class
      Returns:
      the boolean
    • isSubclassOf

      public static boolean isSubclassOf(Class<?> clazz, Class<?> parentClass)
      Is subclass of boolean.
      Parameters:
      clazz - the class
      parentClass - the parent class
      Returns:
      the boolean
    • isScalarPrimitive

      public static boolean isScalarPrimitive(Class<?> clazz)
      Is class primitive boolean.
      Parameters:
      clazz - the class
      Returns:
      the boolean
    • arrayToString

      public static final String arrayToString(String[] in)
      String array to string converter.
      Parameters:
      in - the input
      Returns:
      the string
    • listToString

      public static final String listToString(List<?> in)
      List to string converter.
      Parameters:
      in - the input
      Returns:
      the string
    • collectionToString

      public static final String collectionToString(Collection<?> in)
      Collection to string converter.
      Parameters:
      in - the input
      Returns:
      the string
    • doubleEqual

      public static final boolean doubleEqual(Double v1, 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(Double v1, Double v2, Double precision)
      Double equal boolean.
      Parameters:
      v1 - the first double
      v2 - the second double
      precision - the precision of checking
      Returns:
      the boolean