Package io.github.fastclasspathscanner
Class AnnotationEnumValue
- java.lang.Object
-
- io.github.fastclasspathscanner.AnnotationEnumValue
-
- All Implemented Interfaces:
Comparable<AnnotationEnumValue>
public class AnnotationEnumValue extends Object implements Comparable<AnnotationEnumValue>
Class for wrapping an enum constant value (split into class name and constant name) referenced inside an annotation.
-
-
Field Summary
Fields Modifier and Type Field Description protected ScanResult
scanResult
-
Constructor Summary
Constructors Constructor Description AnnotationEnumValue(String className, String constValueName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AnnotationEnumValue o)
boolean
equals(Object o)
String
getClassName()
Return the name of the enum class.String
getName()
Get the fully-qualified name of the enum const value, i.e.String
getValueName()
Return the name of the enum const value.int
hashCode()
Object
loadClassAndReturnEnumValue()
Loads the enum class, if it has not yet been loaded, instantiates the enum constants, and returns the enum constant value represented by thisAnnotationEnumValue
.String
toString()
-
-
-
Field Detail
-
scanResult
protected transient ScanResult scanResult
-
-
Method Detail
-
getClassName
public String getClassName()
Return the name of the enum class.
-
getValueName
public String getValueName()
Return the name of the enum const value.
-
getName
public String getName()
Get the fully-qualified name of the enum const value, i.e. (getClassName() + getConstValueName()).- Returns:
- The fully-qualified name of the enum const value, i.e. (getClassName() + getConstValueName()).
-
loadClassAndReturnEnumValue
public Object loadClassAndReturnEnumValue() throws IllegalArgumentException
Loads the enum class, if it has not yet been loaded, instantiates the enum constants, and returns the enum constant value represented by thisAnnotationEnumValue
.- Returns:
- The enum constant value.
- Throws:
IllegalArgumentException
- if the class could not be loaded, or the enum constant is invalid.
-
compareTo
public int compareTo(AnnotationEnumValue o)
- Specified by:
compareTo
in interfaceComparable<AnnotationEnumValue>
-
-