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, name
private final AnnotationValue[] value
ArrayValue(java.lang.String name, AnnotationValue[] value)
public AnnotationValue[] value()
AnnotationValue
value
in class AnnotationValue
public 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 AnnotationValue
public AnnotationValue.Kind componentKind()
AnnotationValue
AnnotationValue.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 AnnotationValue
AnnotationValue.Kind.UNKNOWN
if it can not be determined.AnnotationValue[] asArray()
asArray
in class AnnotationValue
public java.lang.String toString()
toString
in class AnnotationValue
public int[] asIntArray()
AnnotationValue
asIntArray
in class AnnotationValue
public long[] asLongArray()
AnnotationValue
asLongArray
in class AnnotationValue
public short[] asShortArray()
AnnotationValue
asShortArray
in class AnnotationValue
public byte[] asByteArray()
AnnotationValue
asByteArray
in class AnnotationValue
public float[] asFloatArray()
AnnotationValue
asFloatArray
in class AnnotationValue
public double[] asDoubleArray()
AnnotationValue
asDoubleArray
in class AnnotationValue
public char[] asCharArray()
AnnotationValue
asCharArray
in class AnnotationValue
public boolean[] asBooleanArray()
AnnotationValue
asBooleanArray
in class AnnotationValue
public java.lang.String[] asStringArray()
AnnotationValue
AnnotationValue.asString()
as if it were applied
to every array element.asStringArray
in class AnnotationValue
public java.lang.String[] asEnumArray()
AnnotationValue
Enum.name()
.asEnumArray
in class AnnotationValue
public Type[] asClassArray()
AnnotationValue
AnnotationValue.asClass()
asClassArray
in class AnnotationValue
public AnnotationInstance[] asNestedArray()
AnnotationValue
AnnotationValue.asNested()
asNestedArray
in class AnnotationValue
public DotName[] asEnumTypeArray()
AnnotationValue
Object.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 AnnotationValue
public boolean equals(java.lang.Object o)
AnnotationValue
equals
in class AnnotationValue
o
- the annotation value to compare to.Object.equals(Object)
public int hashCode()
AnnotationValue
hashCode
in class AnnotationValue
Object.hashCode()