Class AnnotationValue.ForConstant<U>
java.lang.Object
net.bytebuddy.description.annotation.AnnotationValue.AbstractBase<U,U>
net.bytebuddy.description.annotation.AnnotationValue.ForConstant<U>
- Type Parameters:
U- The type where primitive values are represented by their boxed type.
- All Implemented Interfaces:
AnnotationValue<U,U>
- Enclosing interface:
AnnotationValue<T,S>
Represents a primitive value, a
String or an array of the latter types.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classRepresents a trivial loaded value.protected static interfaceA property delegate for a constant annotation value.Nested classes/interfaces inherited from interface AnnotationValue
AnnotationValue.AbstractBase<U,V>, AnnotationValue.ForAnnotationDescription<U>, AnnotationValue.ForConstant<U>, AnnotationValue.ForDescriptionArray<U, V>, AnnotationValue.ForEnumerationDescription<U>, AnnotationValue.ForIncompatibleType<U, V>, AnnotationValue.ForMismatchedType<U, V>, AnnotationValue.ForMissingType<U, V>, AnnotationValue.ForMissingValue<U, V>, AnnotationValue.ForTypeDescription<U>, AnnotationValue.RenderingDispatcher, AnnotationValue.Sort, AnnotationValue.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AnnotationValue.ForConstant.PropertyDelegateThe property delegate for the value's type.private final UThe represented value.Fields inherited from interface AnnotationValue
UNDEFINED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForConstant(U value, AnnotationValue.ForConstant.PropertyDelegate propertyDelegate) Creates a new constant annotation value. -
Method Summary
Modifier and TypeMethodDescriptionbooleanfilter(MethodDescription.InDefinedShape property, TypeDefinition typeDefinition) Filters this annotation value as a valid value of the provided property.getSort()Returns the property type of the annotation value.getState()Returns the state of the represented annotation value.inthashCode()load(ClassLoader classLoader) Returns the loaded value of this annotation.static AnnotationValue<Boolean, Boolean> of(boolean value) Creates an annotation value for abooleanvalue.static AnnotationValue<boolean[], boolean[]> of(boolean... value) Creates an annotation value for aboolean[]value.static AnnotationValue<Byte, Byte> of(byte value) Creates an annotation value for abytevalue.static AnnotationValue<byte[], byte[]> of(byte... value) Creates an annotation value for abyte[]value.static AnnotationValue<Character, Character> of(char value) Creates an annotation value for acharvalue.static AnnotationValue<char[], char[]> of(char... value) Creates an annotation value for achar[]value.static AnnotationValue<Double, Double> of(double value) Creates an annotation value for adoublevalue.static AnnotationValue<double[], double[]> of(double... value) Creates an annotation value for adouble[]value.static AnnotationValue<Float, Float> of(float value) Creates an annotation value for afloatvalue.static AnnotationValue<float[], float[]> of(float... value) Creates an annotation value for afloat[]value.static AnnotationValue<Integer, Integer> of(int value) Creates an annotation value for aintvalue.static AnnotationValue<int[], int[]> of(int... value) Creates an annotation value for aint[]value.static AnnotationValue<Long, Long> of(long value) Creates an annotation value for alongvalue.static AnnotationValue<long[], long[]> of(long... value) Creates an annotation value for along[]value.static AnnotationValue<Short, Short> of(short value) Creates an annotation value for ashortvalue.static AnnotationValue<short[], short[]> of(short... value) Creates an annotation value for ashort[]value.static AnnotationValue<?, ?> Creates an annotation value for any constant value, i.e any primitive (wrapper) type, any primitive array type or anyStringvalue or array.static AnnotationValue<String, String> Creates an annotation value for aStringvalue.static AnnotationValue<String[], String[]> Creates an annotation value for aString[]value.resolve()Resolves the unloaded value of this annotation.toString()Methods inherited from class AnnotationValue.AbstractBase
filter, resolve
-
Field Details
-
value
The represented value. -
propertyDelegate
The property delegate for the value's type.
-
-
Constructor Details
-
ForConstant
Creates a new constant annotation value.- Parameters:
value- The represented value.propertyDelegate- The property delegate for the value's type.
-
-
Method Details
-
of
Creates an annotation value for abooleanvalue.- Parameters:
value- Thebooleanvalue to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for abytevalue.- Parameters:
value- Thebytevalue to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for ashortvalue.- Parameters:
value- Theshortvalue to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for acharvalue.- Parameters:
value- Thecharvalue to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for aintvalue.- Parameters:
value- Theintvalue to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for alongvalue.- Parameters:
value- Thelongvalue to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for afloatvalue.- Parameters:
value- Thefloatvalue to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for adoublevalue.- Parameters:
value- Thedoublevalue to represent.- Returns:
- An appropriate annotation value.
-
of
-
of
Creates an annotation value for aboolean[]value.- Parameters:
value- Theboolean[]value to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for abyte[]value.- Parameters:
value- Thebyte[]value to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for ashort[]value.- Parameters:
value- Theshort[]value to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for achar[]value.- Parameters:
value- Thechar[]value to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for aint[]value.- Parameters:
value- Theint[]value to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for along[]value.- Parameters:
value- Thelong[]value to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for afloat[]value.- Parameters:
value- Thefloat[]value to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for adouble[]value.- Parameters:
value- Thedouble[]value to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for aString[]value.- Parameters:
value- TheString[]value to represent.- Returns:
- An appropriate annotation value.
-
of
Creates an annotation value for any constant value, i.e any primitive (wrapper) type, any primitive array type or anyStringvalue or array. If no constant annotation type is provided, a runtime exception is thrown.- Parameters:
value- The value to represent.- Returns:
- An appropriate annotation value.
-
getState
Returns the state of the represented annotation value.- Returns:
- The state represented by this instance.
-
getSort
Returns the property type of the annotation value.- Returns:
- The property type of the annotation value.
-
filter
public AnnotationValue<U,U> filter(MethodDescription.InDefinedShape property, TypeDefinition typeDefinition) Filters this annotation value as a valid value of the provided property.- Parameters:
property- The property to filter against.typeDefinition- The expected type.- Returns:
- This annotation value or a new annotation value that describes why this value is not a valid value for the supplied property.
-
resolve
Resolves the unloaded value of this annotation. The return value of this method is not defined if this annotation value is invalid.- Returns:
- The unloaded value of this annotation.
-
load
Returns the loaded value of this annotation.- Parameters:
classLoader- The class loader for loading this value ornullfor using the boot loader.- Returns:
- The loaded value of this annotation.
-
hashCode
-
equals
-
toString
-