U
- The type where primitive values are represented by their boxed type.public static class AnnotationValue.ForConstant<U> extends AnnotationValue.AbstractBase<U,U>
String
or an array of the latter types.Modifier and Type | Class and Description |
---|---|
protected static class |
AnnotationValue.ForConstant.Loaded<V>
Represents a trivial loaded value.
|
protected static interface |
AnnotationValue.ForConstant.PropertyDelegate
A property delegate for a constant annotation value.
|
AnnotationValue.AbstractBase<U,V>, AnnotationValue.ForAnnotationDescription<U extends Annotation>, AnnotationValue.ForConstant<U>, AnnotationValue.ForDescriptionArray<U,V>, AnnotationValue.ForEnumerationDescription<U extends Enum<U>>, AnnotationValue.ForTypeDescription<U extends Class<U>>, AnnotationValue.RenderingDispatcher
UNDEFINED
Modifier | Constructor and Description |
---|---|
protected |
ForConstant(U value,
AnnotationValue.ForConstant.PropertyDelegate propertyDelegate)
Creates a new constant annotation value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
hashCode() |
AnnotationValue.Loaded<U> |
load(ClassLoader classLoader)
Returns the loaded value of this annotation.
|
static AnnotationValue<boolean[],boolean[]> |
of(boolean... value)
Creates an annotation value for a
boolean[] value. |
static AnnotationValue<Boolean,Boolean> |
of(boolean value)
Creates an annotation value for a
boolean value. |
static AnnotationValue<byte[],byte[]> |
of(byte... value)
Creates an annotation value for a
byte[] value. |
static AnnotationValue<Byte,Byte> |
of(byte value)
Creates an annotation value for a
byte value. |
static AnnotationValue<char[],char[]> |
of(char... value)
Creates an annotation value for a
char[] value. |
static AnnotationValue<Character,Character> |
of(char value)
Creates an annotation value for a
char value. |
static AnnotationValue<double[],double[]> |
of(double... value)
Creates an annotation value for a
double[] value. |
static AnnotationValue<Double,Double> |
of(double value)
Creates an annotation value for a
double value. |
static AnnotationValue<float[],float[]> |
of(float... value)
Creates an annotation value for a
float[] value. |
static AnnotationValue<Float,Float> |
of(float value)
Creates an annotation value for a
float value. |
static AnnotationValue<int[],int[]> |
of(int... value)
Creates an annotation value for a
int[] value. |
static AnnotationValue<Integer,Integer> |
of(int value)
Creates an annotation value for a
int value. |
static AnnotationValue<long[],long[]> |
of(long... value)
Creates an annotation value for a
long[] value. |
static AnnotationValue<Long,Long> |
of(long value)
Creates an annotation value for a
long value. |
static AnnotationValue<?,?> |
of(Object value)
Creates an annotation value for any constant value, i.e any primitive (wrapper) type,
any primitive array type or any
String value or array. |
static AnnotationValue<short[],short[]> |
of(short... value)
Creates an annotation value for a
short[] value. |
static AnnotationValue<Short,Short> |
of(short value)
Creates an annotation value for a
short value. |
static AnnotationValue<String[],String[]> |
of(String... value)
Creates an annotation value for a
String[] value. |
static AnnotationValue<String,String> |
of(String value)
Creates an annotation value for a
String value. |
U |
resolve()
Resolves the unloaded value of this annotation.
|
String |
toString() |
loadSilent, resolve
protected ForConstant(U value, AnnotationValue.ForConstant.PropertyDelegate propertyDelegate)
value
- The represented value.propertyDelegate
- The property delegate for the value's type.public static AnnotationValue<Boolean,Boolean> of(boolean value)
boolean
value.value
- The boolean
value to represent.public static AnnotationValue<Byte,Byte> of(byte value)
byte
value.value
- The byte
value to represent.public static AnnotationValue<Short,Short> of(short value)
short
value.value
- The short
value to represent.public static AnnotationValue<Character,Character> of(char value)
char
value.value
- The char
value to represent.public static AnnotationValue<Integer,Integer> of(int value)
int
value.value
- The int
value to represent.public static AnnotationValue<Long,Long> of(long value)
long
value.value
- The long
value to represent.public static AnnotationValue<Float,Float> of(float value)
float
value.value
- The float
value to represent.public static AnnotationValue<Double,Double> of(double value)
double
value.value
- The double
value to represent.public static AnnotationValue<String,String> of(String value)
String
value.value
- The String
value to represent.public static AnnotationValue<boolean[],boolean[]> of(boolean... value)
boolean[]
value.value
- The boolean[]
value to represent.public static AnnotationValue<byte[],byte[]> of(byte... value)
byte[]
value.value
- The byte[]
value to represent.public static AnnotationValue<short[],short[]> of(short... value)
short[]
value.value
- The short[]
value to represent.public static AnnotationValue<char[],char[]> of(char... value)
char[]
value.value
- The char[]
value to represent.public static AnnotationValue<int[],int[]> of(int... value)
int[]
value.value
- The int[]
value to represent.public static AnnotationValue<long[],long[]> of(long... value)
long[]
value.value
- The long[]
value to represent.public static AnnotationValue<float[],float[]> of(float... value)
float[]
value.value
- The float[]
value to represent.public static AnnotationValue<double[],double[]> of(double... value)
double[]
value.value
- The double[]
value to represent.public static AnnotationValue<String[],String[]> of(String... value)
String[]
value.value
- The String[]
value to represent.public static AnnotationValue<?,?> of(Object value)
String
value or array. If no constant annotation
type is provided, a runtime exception is thrown.value
- The value to represent.public U resolve()
public AnnotationValue.Loaded<U> load(ClassLoader classLoader)
classLoader
- The class loader for loading this value.Copyright © 2014–2019. All rights reserved.