Class AnnotationInfo
- java.lang.Object
-
- io.github.lukehutch.fastclasspathscanner.scanner.AnnotationInfo
-
- All Implemented Interfaces:
Comparable<AnnotationInfo>
public class AnnotationInfo extends Object implements Comparable<AnnotationInfo>
Holds metadata about annotations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnnotationInfo.AnnotationClassRefStores a class descriptor in an annotation as a class type string, e.g.static classAnnotationInfo.AnnotationEnumValueClass for wrapping an enum constant value (split into class name and constant name) referenced inside an annotation.static classAnnotationInfo.AnnotationParamValueA wrapper used to pair annotation parameter names with annotation parameter values.
-
Constructor Summary
Constructors Constructor Description AnnotationInfo(String annotationName, List<AnnotationInfo.AnnotationParamValue> annotationParamValues)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(AnnotationInfo o)booleanequals(Object obj)StringgetAnnotationName()Get the name of the annotation.List<AnnotationInfo.AnnotationParamValue>getAnnotationParamValues()Get the parameter value of the annotation.Class<?>getAnnotationType()Get a class reference for the annotation.static String[]getUniqueAnnotationNamesSorted(AnnotationInfo[] annotationInfo)From an array of AnnotationInfo objects, extract the annotation names, uniquify them, and sort them.static String[]getUniqueAnnotationNamesSorted(Collection<AnnotationInfo> annotationInfo)From a collection of AnnotationInfo objects, extract the annotation names, uniquify them, and sort them.inthashCode()StringtoString()voidtoString(StringBuilder buf)Render as a string, into a StringBuilder buffer.
-
-
-
Constructor Detail
-
AnnotationInfo
public AnnotationInfo(String annotationName, List<AnnotationInfo.AnnotationParamValue> annotationParamValues)
- Parameters:
annotationName- The name of the annotation.annotationParamValues- The annotation parameter values, or null if none.
-
-
Method Detail
-
getAnnotationName
public String getAnnotationName()
Get the name of the annotation.- Returns:
- The annotation name.
-
getAnnotationType
public Class<?> getAnnotationType()
Get a class reference for the annotation.- Returns:
- The annotation type, as a
Class<?>reference.
-
getAnnotationParamValues
public List<AnnotationInfo.AnnotationParamValue> getAnnotationParamValues()
Get the parameter value of the annotation.- Returns:
- The annotation parameter values.
-
compareTo
public int compareTo(AnnotationInfo o)
- Specified by:
compareToin interfaceComparable<AnnotationInfo>
-
toString
public void toString(StringBuilder buf)
Render as a string, into a StringBuilder buffer.- Parameters:
buf- The buffer.
-
getUniqueAnnotationNamesSorted
public static String[] getUniqueAnnotationNamesSorted(Collection<AnnotationInfo> annotationInfo)
From a collection of AnnotationInfo objects, extract the annotation names, uniquify them, and sort them.- Parameters:
annotationInfo- The annotation info.- Returns:
- The sorted, uniquified annotation names.
-
getUniqueAnnotationNamesSorted
public static String[] getUniqueAnnotationNamesSorted(AnnotationInfo[] annotationInfo)
From an array of AnnotationInfo objects, extract the annotation names, uniquify them, and sort them.- Parameters:
annotationInfo- The annotation info.- Returns:
- The sorted, uniquified annotation names.
-
-