T
- The generic type of the underlying classpublic final class AnnotationClassValue<T> extends java.lang.Object implements java.lang.CharSequence, Named
getType()
method will return a non-empty optional.Modifier and Type | Field and Description |
---|---|
static AnnotationClassValue<?>[] |
EMPTY_ARRAY
An empty array of class values.
|
Constructor and Description |
---|
AnnotationClassValue(java.lang.Class<T> theClass)
Constructs a class value for a type that is present.
|
AnnotationClassValue(java.lang.String name)
Constructs a class value for the type that is not present.
|
AnnotationClassValue(java.lang.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.
|
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index) |
boolean |
equals(java.lang.Object o) |
java.util.Optional<T> |
getInstance()
Returns the backing instance if there is one.
|
java.lang.String |
getName() |
java.util.Optional<java.lang.Class<T>> |
getType()
The type if present on the classpath.
|
int |
hashCode() |
boolean |
isInstantiated()
Return whether the class value is instantiated.
|
int |
length() |
java.lang.CharSequence |
subSequence(int start,
int end) |
java.lang.String |
toString() |
public static final AnnotationClassValue<?>[] EMPTY_ARRAY
@Internal public AnnotationClassValue(java.lang.String name)
name
- The name of the type.public AnnotationClassValue(java.lang.Class<T> theClass)
theClass
- The type@Internal public AnnotationClassValue(@NonNull java.lang.String name, boolean instantiated)
name
- the class nameinstantiated
- Whether at runtime an instance should be instantiatedpublic AnnotationClassValue(@NonNull T instance)
instance
- The instnace@NonNull public java.util.Optional<T> getInstance()
public boolean isInstantiated()
getInstance()
, except at compilation time where instances are not instantiated.public java.util.Optional<java.lang.Class<T>> getType()
public java.lang.String getName()
public int length()
length
in interface java.lang.CharSequence
public char charAt(int index)
charAt
in interface java.lang.CharSequence
public java.lang.CharSequence subSequence(int start, int end)
subSequence
in interface java.lang.CharSequence
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object