Class Util


  • public class Util
    extends java.lang.Object
    A few utility methods, mostly for private use.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean isAndroid  
    • Constructor Summary

      Constructors 
      Constructor Description
      Util()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String className​(java.lang.Class type)
      Returns the class formatted as a string.
      static int getDimensionCount​(java.lang.Class arrayClass)
      Returns the number of dimensions of an array.
      static java.lang.Class getElementClass​(java.lang.Class arrayClass)
      Returns the base element type of an n-dimensional array class.
      static java.lang.Class getWrapperClass​(java.lang.Class type)
      Returns the primitive wrapper class for a primitive class.
      static boolean isWrapperClass​(java.lang.Class type)  
      static void log​(java.lang.String message, java.lang.Object object)
      Logs a message about an object.
      static java.lang.String string​(java.lang.Object object)
      Returns the object formatted as a string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • isAndroid

        public static boolean isAndroid
    • Constructor Detail

      • Util

        public Util()
    • Method Detail

      • getWrapperClass

        public static java.lang.Class getWrapperClass​(java.lang.Class type)
        Returns the primitive wrapper class for a primitive class.
        Parameters:
        type - Must be a primitive class.
      • isWrapperClass

        public static boolean isWrapperClass​(java.lang.Class type)
      • log

        public static void log​(java.lang.String message,
                               java.lang.Object object)
        Logs a message about an object. The log level and the string format of the object depend on the object type.
      • string

        public static java.lang.String string​(java.lang.Object object)
        Returns the object formatted as a string. The format depends on the object's type and whether Object.toString() has been overridden.
      • className

        public static java.lang.String className​(java.lang.Class type)
        Returns the class formatted as a string. The format varies depending on the type.
      • getDimensionCount

        public static int getDimensionCount​(java.lang.Class arrayClass)
        Returns the number of dimensions of an array.
      • getElementClass

        public static java.lang.Class getElementClass​(java.lang.Class arrayClass)
        Returns the base element type of an n-dimensional array class.