Class ClassDeterministic

java.lang.Object
org.plumelib.util.ClassDeterministic

public class ClassDeterministic extends Object
Deterministic versions of java.lang.Class methods, which return arrays in sorted order.
  • Method Details

    • getAnnotations

      public static Annotation[] getAnnotations(Class<?> c)
      Like Class.getAnnotations(), but returns the methods in deterministic order.
      Parameters:
      c - the Class whose annotations to return
      Returns:
      the class's annotations
    • getDeclaredAnnotations

      public static Annotation[] getDeclaredAnnotations(Class<?> c)
      Like Class.getDeclaredAnnotations(), but returns the methods in deterministic order.
      Parameters:
      c - the Class whose declared annotations to return
      Returns:
      the class's declared annotations
    • getClasses

      public static Class<?>[] getClasses(Class<?> c)
      Like Class.getClasses(), but returns the classes in deterministic order.
      Parameters:
      c - the Class whose member classes to return
      Returns:
      the class's member classes
    • getDeclaredClasses

      public static Class<?>[] getDeclaredClasses(Class<?> c)
      Like Class.getDeclaredClasses(), but returns the classes in deterministic order.
      Parameters:
      c - the Class whose declared member classes to return
      Returns:
      the class's declared member classes
    • getEnumConstants

      public static <@Interned T> T @Nullable [] getEnumConstants(Class<@Interned T> c)
      Like Class.getEnumConstants(), but returns the methods in deterministic order. Returns null if the argument is not an enum class.
      Type Parameters:
      T - the class's type parameter
      Parameters:
      c - the Class whose enum constants to return
      Returns:
      the class's enum constants
    • getConstructors

      public static Constructor<?>[] getConstructors(Class<?> c)
      Like Class.getConstructors(), but returns the methods in deterministic order.
      Parameters:
      c - the Class whose constructors to return
      Returns:
      the class's constructors
    • getDeclaredConstructors

      public static Constructor<?>[] getDeclaredConstructors(Class<?> c)
      Like Class.getDeclaredConstructors(), but returns the methods in deterministic order.
      Parameters:
      c - the Class whose declared constructors to return
      Returns:
      the class's declared constructors
    • getFields

      public static Field[] getFields(Class<?> c)
      Like Class.getFields(), but returns the methods in deterministic order.
      Parameters:
      c - the Class whose fields to return
      Returns:
      the class's fields
    • getDeclaredFields

      public static Field[] getDeclaredFields(Class<?> c)
      Like Class.getDeclaredFields(), but returns the methods in deterministic order.
      Parameters:
      c - the Class whose declared fields to return
      Returns:
      the class's declared fields
    • getMethods

      public static Method[] getMethods(Class<?> c)
      Like Class.getMethods(), but returns the methods in deterministic order.
      Parameters:
      c - the Class whose methods to return
      Returns:
      the class's methods
    • getDeclaredMethods

      public static Method[] getDeclaredMethods(Class<?> c)
      Like Class.getDeclaredMethods(), but returns the methods in deterministic order.
      Parameters:
      c - the Class whose declared methods to return
      Returns:
      the class's declared methods