Class MiscUtil


  • public abstract class MiscUtil
    extends Object
    Author:
    Rein Raudjärv
    • Constructor Detail

      • MiscUtil

        public MiscUtil()
    • Method Detail

      • identityToString

        public static String identityToString​(Object obj)
        Return a String representation of an object's overall identity.
        Parameters:
        obj - the object (may be null)
        Returns:
        the object's identity as String representation, or null String if the object was null
      • identityToString

        public static String identityToString​(Class<?> klass)
        Return a String representation of a class' overall identity.
        Parameters:
        klass - the class (may be null)
        Returns:
        the class' identity as String representation, or null String if the class was null
      • identityToString

        public static String identityToString​(Class<?>[] classes)
        Return a String representation of a classes' overall identities.
        Parameters:
        classes - the classes (may be null)
        Returns:
        the classes' identities as String representation, or null String if the class was null
      • dumpToString

        public static String dumpToString​(Object obj)
        Return a String representation of an object. Use Object.toString() for classes under org.zeroturnaround.javarebel package. Otherwise use identityToString(Object).
        Parameters:
        obj - the object (may be null)
        Returns:
        a String representation of an object.
      • add

        public static Class<?>[] add​(Class<?>[] array,
                                     Class<?> element)
        Adds a class to an array.
      • getSystemClassLoader

        public static ClassLoader getSystemClassLoader()
      • getContextClassLoader

        public static final ClassLoader getContextClassLoader()
      • objectEquals

        public static boolean objectEquals​(Object first,
                                           Object second)
      • indexOf

        public static int indexOf​(byte[] haystack,
                                  byte[] needle)
      • getVmArguments

        public static List<String> getVmArguments()
      • isInContainerTempDir

        public static boolean isInContainerTempDir​(File file)
        checks if provided file is in container temp dir, if container has temp dir integration present.
      • hash32

        public static int hash32​(byte[] bytes)