static final class AnnotationValue.ArrayValue extends AnnotationValue
AnnotationValue.ArrayValue, AnnotationValue.BooleanValue, AnnotationValue.ByteValue, AnnotationValue.CharacterValue, AnnotationValue.ClassValue, AnnotationValue.DoubleValue, AnnotationValue.EnumValue, AnnotationValue.FloatValue, AnnotationValue.IntegerValue, AnnotationValue.Kind, AnnotationValue.LongValue, AnnotationValue.NestedAnnotation, AnnotationValue.ShortValue, AnnotationValue.StringValue| Modifier and Type | Field and Description |
|---|---|
private AnnotationValue[] |
value |
EMPTY_VALUE_ARRAY| Constructor and Description |
|---|
ArrayValue(java.lang.String name,
AnnotationValue[] value) |
| Modifier and Type | Method and Description |
|---|---|
(package private) AnnotationValue[] |
asArray() |
boolean[] |
asBooleanArray()
Returns the underlying boolean array.
|
byte[] |
asByteArray()
Converts an underlying numerical array to a Java primitive byte array.
|
char[] |
asCharArray()
Returns the underlying character array.
|
Type[] |
asClassArray()
Returns an array of class types representing the underlying class array value.
|
double[] |
asDoubleArray()
Converts an underlying numerical array to a Java primitive double array.
|
java.lang.String[] |
asEnumArray()
Returns an array of the constant name, in string form, that represents the
Java enumeration of each array element The individual element values are
the same as the one returned by
Enum.name(). |
DotName[] |
asEnumTypeArray()
Returns an array of the type name, in DotName form, that represents the
Java enumeration of each array element.
|
float[] |
asFloatArray()
Converts an underlying numerical array to a Java primitive float array.
|
int[] |
asIntArray()
Converts an underlying numerical array to a Java primitive
integer array.
|
long[] |
asLongArray()
Converts an underlying numerical array to a Java primitive
long array.
|
AnnotationInstance[] |
asNestedArray()
Returns an array of nested annotations representing the underlying annotation array value.
|
short[] |
asShortArray()
Converts an underlying numerical array to a Java primitive short array.
|
java.lang.String[] |
asStringArray()
Returns a string array representation of the underlying array value.
|
AnnotationValue.Kind |
componentKind()
Returns the kind of value that represents the component type of this array if it can be determined.
|
boolean |
equals(java.lang.Object o)
Compares this annotation value to another annotation value, and returns true if equal.
|
int |
hashCode()
Computes a hash code for this annotation value.
|
AnnotationValue.Kind |
kind()
Returns the kind of this value.
|
java.lang.String |
toString() |
AnnotationValue[] |
value()
Returns a detyped value that represents the underlying annotation value.
|
asBoolean, asByte, asChar, asClass, asDouble, asEnum, asEnumType, asFloat, asInt, asLong, asNested, asShort, asString, createArrayValue, createBooleanValue, createByteValue, createCharacterValue, createClassValue, createDouleValue, createEnumValue, createFloatValue, createIntegerValue, createLongalue, createNestedAnnotationValue, createShortValue, createStringValue, nameprivate final AnnotationValue[] value
ArrayValue(java.lang.String name,
AnnotationValue[] value)
public AnnotationValue[] value()
AnnotationValuevalue in class AnnotationValuepublic AnnotationValue.Kind kind()
AnnotationValue
A special AnnotationValue.Kind.UNKNOWN kind is used to refer to components
of zero-length arrays, as the underlying type is not known.
kind in class AnnotationValuepublic AnnotationValue.Kind componentKind()
AnnotationValueAnnotationValue.Kind.UNKNOWN. This happens when the annotation value represents
an empty array. If the underlying value is not an array an exception will be thrown.componentKind in class AnnotationValueAnnotationValue.Kind.UNKNOWN if it can not be determined.AnnotationValue[] asArray()
asArray in class AnnotationValuepublic java.lang.String toString()
toString in class AnnotationValuepublic int[] asIntArray()
AnnotationValueasIntArray in class AnnotationValuepublic long[] asLongArray()
AnnotationValueasLongArray in class AnnotationValuepublic short[] asShortArray()
AnnotationValueasShortArray in class AnnotationValuepublic byte[] asByteArray()
AnnotationValueasByteArray in class AnnotationValuepublic float[] asFloatArray()
AnnotationValueasFloatArray in class AnnotationValuepublic double[] asDoubleArray()
AnnotationValueasDoubleArray in class AnnotationValuepublic char[] asCharArray()
AnnotationValueasCharArray in class AnnotationValuepublic boolean[] asBooleanArray()
AnnotationValueasBooleanArray in class AnnotationValuepublic java.lang.String[] asStringArray()
AnnotationValueAnnotationValue.asString() as if it were applied
to every array element.asStringArray in class AnnotationValuepublic java.lang.String[] asEnumArray()
AnnotationValueEnum.name().asEnumArray in class AnnotationValuepublic Type[] asClassArray()
AnnotationValueAnnotationValue.asClass()asClassArray in class AnnotationValuepublic AnnotationInstance[] asNestedArray()
AnnotationValueAnnotationValue.asNested()asNestedArray in class AnnotationValuepublic DotName[] asEnumTypeArray()
AnnotationValueObject.getClass(). Note that JLS
restricts an enum array parameter to the same type. Also, when an empty
array is specified in a value, it's types can not be determined.asEnumTypeArray in class AnnotationValuepublic boolean equals(java.lang.Object o)
AnnotationValueequals in class AnnotationValueo - the annotation value to compare to.Object.equals(Object)public int hashCode()
AnnotationValuehashCode in class AnnotationValueObject.hashCode()