Interface AnnotationElement
public sealed interface AnnotationElement
Models an element-value pair in the
element_value_pairs
table in the annotation
structure defined in JVMS
4.7.16 or the type_annotation
structure defined
in JVMS 4.7.20.
Two AnnotationElement
objects should be compared using the
equals
method.
- Since:
- 24
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionname()
Returns the element name.static AnnotationElement
of
(Utf8Entry name, AnnotationValue value) Returns an element-value pair.static AnnotationElement
of
(String name, AnnotationValue value) Returns an element-value pair.static AnnotationElement
ofAnnotation
(String name, Annotation value) Returns an element-value pair for an annotation-valued element.static AnnotationElement
ofArray
(String name, AnnotationValue... values) Returns an element-value pair for an array-valued element.static AnnotationElement
Returns an element-value pair for a boolean-valued element.static AnnotationElement
Returns an element-value pair for a byte-valued element.static AnnotationElement
Returns an element-value pair for a char-valued element.static AnnotationElement
Returns an element-value pair for a class-valued element.static AnnotationElement
Returns an element-value pair for a double-valued element.static AnnotationElement
Returns an element-value pair for a float-valued element.static AnnotationElement
Returns an element-value pair for an int-valued element.static AnnotationElement
Returns an element-value pair for a long-valued element.static AnnotationElement
Returns an element-value pair for a short-valued element.static AnnotationElement
Returns an element-value pair for a string-valued element.value()
Returns the element value.
-
Method Details
-
name
Utf8Entry name()Returns the element name. -
value
-
of
Returns an element-value pair.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair
-
of
Returns an element-value pair.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair
-
ofClass
Returns an element-value pair for a class-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for a class-valued element
- See Also:
-
ofString
Returns an element-value pair for a string-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for a string-valued element
- See Also:
-
ofLong
Returns an element-value pair for a long-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for a long-valued element
- See Also:
-
ofInt
Returns an element-value pair for an int-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for an int-valued element
- See Also:
-
ofChar
Returns an element-value pair for a char-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for a char-valued element
- See Also:
-
ofShort
Returns an element-value pair for a short-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for a short-valued element
- See Also:
-
ofByte
Returns an element-value pair for a byte-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for a byte-valued element
- See Also:
-
ofBoolean
Returns an element-value pair for a boolean-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for a boolean-valued element
- See Also:
-
ofDouble
Returns an element-value pair for a double-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for a double-valued element
- See Also:
-
ofFloat
Returns an element-value pair for a float-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for a float-valued element
- See Also:
-
ofAnnotation
Returns an element-value pair for an annotation-valued element.- Parameters:
name
- the name of the keyvalue
- the associated value- Returns:
- an element-value pair for an annotation-valued element
- See Also:
-
ofArray
Returns an element-value pair for an array-valued element.- Parameters:
name
- the name of the keyvalues
- the associated values- Returns:
- an element-value pair for an array-valued element
- See Also:
-