Class AnnotationValue.ShortValue
java.lang.Object
org.jboss.jandex.AnnotationValue
org.jboss.jandex.AnnotationValue.ShortValue
- Enclosing class:
AnnotationValue
-
Nested Class Summary
Nested classes/interfaces inherited from class 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 -
Field Summary
FieldsFields inherited from class AnnotationValue
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyteasByte()Converts the underlying numerical type to a byte as if it was casted in Java.doubleasDouble()Converts the underlying numerical type to a double as if it was casted in Java.floatasFloat()Converts the underlying numerical type to a float as if it was casted in Java.intasInt()Converts the underlying numerical type to an integer as if it was casted in Java.longasLong()Converts the underlying numerical type to an long as if it was casted in Java.shortasShort()Converts the underlying numerical type to a short as if it was casted in Java.booleanCompares this annotation value to another annotation value, and returns true if equal.inthashCode()Computes a hash code for this annotation value.kind()Returns the kind of this value.value()Returns a detyped value that represents the underlying annotation value.Methods inherited from class AnnotationValue
asArray, asArrayList, asBoolean, asBooleanArray, asByteArray, asChar, asCharArray, asClass, asClassArray, asDoubleArray, asEnum, asEnumArray, asEnumType, asEnumTypeArray, asFloatArray, asIntArray, asLongArray, asNested, asNestedArray, asShortArray, asString, asStringArray, componentKind, createArrayValue, createArrayValue, createBooleanValue, createByteValue, createCharacterValue, createClassValue, createDoubleValue, createDouleValue, createEnumValue, createFloatValue, createIntegerValue, createLongalue, createLongValue, createNestedAnnotationValue, createShortValue, createStringValue, name, toString, toString
-
Field Details
-
value
private final short value
-
-
Constructor Details
-
ShortValue
ShortValue(String name, short value)
-
-
Method Details
-
value
Description copied from class:AnnotationValueReturns a detyped value that represents the underlying annotation value. It is recommended that the type specific methods be used instead.- Specified by:
valuein classAnnotationValue- Returns:
- the underlying value
-
kind
Description copied from class:AnnotationValueReturns the kind of this value. The kind includes all Java primitives, String and Enum types, nested values, and finally arrays of the above. Since the return type is itself an enumeration, it can be used with Java switch statements.A special
AnnotationValue.Kind.UNKNOWNkind is used to refer to components of zero-length arrays, as the underlying type is not known.- Specified by:
kindin classAnnotationValue- Returns:
- the kind of value
-
asInt
public int asInt()Description copied from class:AnnotationValueConverts the underlying numerical type to an integer as if it was casted in Java.- Overrides:
asIntin classAnnotationValue- Returns:
- an integer representing the numerical parameter
-
asLong
public long asLong()Description copied from class:AnnotationValueConverts the underlying numerical type to an long as if it was casted in Java.- Overrides:
asLongin classAnnotationValue- Returns:
- a long representing the numerical parameter
-
asShort
public short asShort()Description copied from class:AnnotationValueConverts the underlying numerical type to a short as if it was casted in Java.- Overrides:
asShortin classAnnotationValue- Returns:
- a short representing the numerical parameter
-
asByte
public byte asByte()Description copied from class:AnnotationValueConverts the underlying numerical type to a byte as if it was casted in Java.- Overrides:
asBytein classAnnotationValue- Returns:
- a byte representing the numerical parameter
-
asFloat
public float asFloat()Description copied from class:AnnotationValueConverts the underlying numerical type to a float as if it was casted in Java.- Overrides:
asFloatin classAnnotationValue- Returns:
- a float representing the numerical parameter
-
asDouble
public double asDouble()Description copied from class:AnnotationValueConverts the underlying numerical type to a double as if it was casted in Java.- Overrides:
asDoublein classAnnotationValue- Returns:
- a double representing the numerical parameter
-
equals
Description copied from class:AnnotationValueCompares this annotation value to another annotation value, and returns true if equal.- Overrides:
equalsin classAnnotationValue- Parameters:
o- the annotation value to compare to.- Returns:
- true if equal, false if not
- See Also:
-
hashCode
public int hashCode()Description copied from class:AnnotationValueComputes a hash code for this annotation value.- Overrides:
hashCodein classAnnotationValue- Returns:
- the hash code for this annotation value
- See Also:
-