Class AnnotationClassValue<T>
java.lang.Object
io.micronaut.core.annotation.AnnotationClassValue<T>
- Type Parameters:
T- The generic type of the underlying class
- All Implemented Interfaces:
Named, CharSequence
An annotation class value is a reference to a class in annotation metadata. The class may or may not be present
on the classpath. If it is present then the
getType() method will return a non-empty optional.- Since:
- 1.0
- Author:
- graemerocher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresented an unresolved type. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AnnotationClassValue<?>[]An empty array of class values. -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationClassValue(Class<T> theClass) Constructs a class value for a type that is present.AnnotationClassValue(String name) Constructs a class value for the type that is not present.AnnotationClassValue(String name, boolean instantiated) Constructs a class value for a type that is present.AnnotationClassValue(T instance) Constructs a class value for a type that is present. -
Method Summary
Methods inherited from interface CharSequence
chars, codePoints, getChars, isEmpty
-
Field Details
-
ZERO_ANNOTATION_CLASS_VALUES
An empty array of class values.
-
-
Constructor Details
-
AnnotationClassValue
-
AnnotationClassValue
-
AnnotationClassValue
-
AnnotationClassValue
Constructs a class value for a type that is present.- Parameters:
instance- The instance- Since:
- 1.1
-
-
Method Details
-
getInstance
-
isInstantiated
public boolean isInstantiated()Return whether the class value is instantiated. Normally this is the same as using isPresent ongetInstance(), except at compilation time when instances are not instantiated.- Returns:
- Whether this class value is instantiated
- Since:
- 1.1
-
getType
-
getName
-
length
public int length()- Specified by:
lengthin interfaceCharSequence
-
charAt
public char charAt(int index) - Specified by:
charAtin interfaceCharSequence
-
subSequence
- Specified by:
subSequencein interfaceCharSequence
-
toString
- Specified by:
toStringin interfaceCharSequence- Overrides:
toStringin classObject
-
equals
-
hashCode
-