Package org.plumelib.util
Class ClassDeterministic
java.lang.Object
org.plumelib.util.ClassDeterministic
Deterministic versions of
java.lang.Class methods, which return arrays in sorted order.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classCompares Annotation objects by type name.private static classCompares Class objects by fully-qualified name.private static classCompares Constructor objects by signature: compares name, number of parameters, and parameter type names.private static classCompares Field objects by name.private static classCompares Method objects by signature: compares name, number of parameters, parameter type names, declaring class, and return type (which is necessary to distinguish bridge methods).private static classCompares objects by the result of toString(). -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static ClassDeterministic.AnnotationComparatorCompares Annotation objects by type name.(package private) static ClassDeterministic.ClassComparatorCompares Class objects by fully-qualified name.(package private) static ClassDeterministic.ConstructorComparatorCompares Constructor objects by signature: compares name, number of parameters, and parameter type names.(package private) static ClassDeterministic.FieldComparatorCompares Field objects by name.(package private) static ClassDeterministic.MethodComparatorCompares Method objects by signature: compares name, number of parameters, parameter type names, declaring class, and return type (which is necessary to distinguish bridge methods).(package private) static ClassDeterministic.ToStringComparatorCompares objects by the result of toString(). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDo not call; this class is a collection of methods and does not represent anything. -
Method Summary
Modifier and TypeMethodDescriptionstatic Annotation[]getAnnotations(Class<?> c) LikeClass.getAnnotations(), but returns the methods in deterministic order.static Class<?>[]getClasses(Class<?> c) LikeClass.getClasses(), but returns the classes in deterministic order.static Constructor<?>[]getConstructors(Class<?> c) LikeClass.getConstructors(), but returns the methods in deterministic order.static Annotation[]getDeclaredAnnotations(Class<?> c) LikeClass.getDeclaredAnnotations(), but returns the methods in deterministic order.static Class<?>[]getDeclaredClasses(Class<?> c) LikeClass.getDeclaredClasses(), but returns the classes in deterministic order.static Constructor<?>[]getDeclaredConstructors(Class<?> c) LikeClass.getDeclaredConstructors(), but returns the methods in deterministic order.static Field[]getDeclaredFields(Class<?> c) LikeClass.getDeclaredFields(), but returns the methods in deterministic order.static Method[]getDeclaredMethods(Class<?> c) LikeClass.getDeclaredMethods(), but returns the methods in deterministic order.static <@Interned T>
T @Nullable []getEnumConstants(Class<@Interned T> c) LikeClass.getEnumConstants(), but returns the methods in deterministic order.static Field[]LikeClass.getFields(), but returns the methods in deterministic order.static Method[]getMethods(Class<?> c) LikeClass.getMethods(), but returns the methods in deterministic order.
-
Field Details
-
annotationComparator
Compares Annotation objects by type name. -
classComparator
Compares Class objects by fully-qualified name. -
methodComparator
Compares Method objects by signature: compares name, number of parameters, parameter type names, declaring class, and return type (which is necessary to distinguish bridge methods). -
constructorComparator
Compares Constructor objects by signature: compares name, number of parameters, and parameter type names. -
fieldComparator
Compares Field objects by name. -
toStringComparator
Compares objects by the result of toString().
-
-
Constructor Details
-
ClassDeterministic
private ClassDeterministic()Do not call; this class is a collection of methods and does not represent anything.
-
-
Method Details
-
getAnnotations
LikeClass.getAnnotations(), but returns the methods in deterministic order.- Parameters:
c- the Class whose annotations to return- Returns:
- the class's annotations
-
getDeclaredAnnotations
LikeClass.getDeclaredAnnotations(), but returns the methods in deterministic order.- Parameters:
c- the Class whose declared annotations to return- Returns:
- the class's declared annotations
-
getClasses
LikeClass.getClasses(), but returns the classes in deterministic order.- Parameters:
c- the Class whose member classes to return- Returns:
- the class's member classes
-
getDeclaredClasses
LikeClass.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
LikeClass.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
LikeClass.getConstructors(), but returns the methods in deterministic order.- Parameters:
c- the Class whose constructors to return- Returns:
- the class's constructors
-
getDeclaredConstructors
LikeClass.getDeclaredConstructors(), but returns the methods in deterministic order.- Parameters:
c- the Class whose declared constructors to return- Returns:
- the class's declared constructors
-
getFields
LikeClass.getFields(), but returns the methods in deterministic order.- Parameters:
c- the Class whose fields to return- Returns:
- the class's fields
-
getDeclaredFields
LikeClass.getDeclaredFields(), but returns the methods in deterministic order.- Parameters:
c- the Class whose declared fields to return- Returns:
- the class's declared fields
-
getMethods
LikeClass.getMethods(), but returns the methods in deterministic order.- Parameters:
c- the Class whose methods to return- Returns:
- the class's methods
-
getDeclaredMethods
LikeClass.getDeclaredMethods(), but returns the methods in deterministic order.- Parameters:
c- the Class whose declared methods to return- Returns:
- the class's declared methods
-