Package org.jboss.jandex
Class AnnotationValue.LongValue
- java.lang.Object
-
- org.jboss.jandex.AnnotationValue
-
- org.jboss.jandex.AnnotationValue.LongValue
-
- Enclosing class:
- AnnotationValue
static final class AnnotationValue.LongValue extends AnnotationValue
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jboss.jandex.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
Fields Modifier and Type Field Description private long
value
-
Fields inherited from class org.jboss.jandex.AnnotationValue
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description LongValue(java.lang.String name, long value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
asByte()
Converts the underlying numerical type to a byte as if it was casted in Java.double
asDouble()
Converts the underlying numerical type to a double as if it was casted in Java.float
asFloat()
Converts the underlying numerical type to a float as if it was casted in Java.int
asInt()
Converts the underlying numerical type to an integer as if it was casted in Java.long
asLong()
Converts the underlying numerical type to an long as if it was casted in Java.short
asShort()
Converts the underlying numerical type to a short as if it was casted in Java.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.Long
value()
Returns a detyped value that represents the underlying annotation value.-
Methods inherited from class org.jboss.jandex.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
-
-
-
-
Method Detail
-
value
public java.lang.Long value()
Description copied from class:AnnotationValue
Returns a detyped value that represents the underlying annotation value. It is recommended that the type specific methods be used instead.- Specified by:
value
in classAnnotationValue
- Returns:
- the underlying value
-
kind
public AnnotationValue.Kind kind()
Description copied from class:AnnotationValue
Returns 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.UNKNOWN
kind is used to refer to components of zero-length arrays, as the underlying type is not known.- Specified by:
kind
in classAnnotationValue
- Returns:
- the kind of value
-
asInt
public int asInt()
Description copied from class:AnnotationValue
Converts the underlying numerical type to an integer as if it was casted in Java.- Overrides:
asInt
in classAnnotationValue
- Returns:
- an integer representing the numerical parameter
-
asLong
public long asLong()
Description copied from class:AnnotationValue
Converts the underlying numerical type to an long as if it was casted in Java.- Overrides:
asLong
in classAnnotationValue
- Returns:
- a long representing the numerical parameter
-
asShort
public short asShort()
Description copied from class:AnnotationValue
Converts the underlying numerical type to a short as if it was casted in Java.- Overrides:
asShort
in classAnnotationValue
- Returns:
- a short representing the numerical parameter
-
asByte
public byte asByte()
Description copied from class:AnnotationValue
Converts the underlying numerical type to a byte as if it was casted in Java.- Overrides:
asByte
in classAnnotationValue
- Returns:
- a byte representing the numerical parameter
-
asFloat
public float asFloat()
Description copied from class:AnnotationValue
Converts the underlying numerical type to a float as if it was casted in Java.- Overrides:
asFloat
in classAnnotationValue
- Returns:
- a float representing the numerical parameter
-
asDouble
public double asDouble()
Description copied from class:AnnotationValue
Converts the underlying numerical type to a double as if it was casted in Java.- Overrides:
asDouble
in classAnnotationValue
- Returns:
- a double representing the numerical parameter
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:AnnotationValue
Compares this annotation value to another annotation value, and returns true if equal.- Overrides:
equals
in classAnnotationValue
- Parameters:
o
- the annotation value to compare to.- Returns:
- true if equal, false if not
- See Also:
Object.equals(Object)
-
hashCode
public int hashCode()
Description copied from class:AnnotationValue
Computes a hash code for this annotation value.- Overrides:
hashCode
in classAnnotationValue
- Returns:
- the hash code for this annotation value
- See Also:
Object.hashCode()
-
-