T
- The generic type of the underlying classpublic final class AnnotationClassValue<T> extends Object implements 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(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.
|
Modifier and Type | Method and Description |
---|---|
char |
charAt(int index) |
boolean |
equals(Object o) |
Optional<T> |
getInstance()
Returns the backing instance if there is one.
|
String |
getName() |
Optional<Class<T>> |
getType()
The type if present on the classpath.
|
int |
hashCode() |
boolean |
isInstantiated()
Return whether the class value is instantiated.
|
int |
length() |
CharSequence |
subSequence(int start,
int end) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
chars, codePoints
public static final AnnotationClassValue<?>[] EMPTY_ARRAY
@Internal public AnnotationClassValue(String name)
name
- The name of the type.public AnnotationClassValue(Class<T> theClass)
theClass
- The type@Internal public AnnotationClassValue(@NonNull String name, boolean instantiated)
name
- the class nameinstantiated
- Whether at runtime an instance should be instantiated@NonNull public Optional<T> getInstance()
public boolean isInstantiated()
getInstance()
, except at compilation time where instances are not instantiated.public String getName()
public int length()
length
in interface CharSequence
public char charAt(int index)
charAt
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public String toString()
toString
in interface CharSequence
toString
in class Object