public class PAnnotation
extends java.lang.Object
Constructor and Description |
---|
PAnnotation(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(java.lang.String attributeName,
java.lang.Object value)
Adds an attribute to the annotation
|
void |
forEachValue(java.util.function.BiConsumer<java.lang.String,java.lang.Object> consumer)
Executes a consumer over all attributes.
|
java.util.Set<java.lang.String> |
getAllAttributeNames()
Returns a set of all attribute names used in this annotation
|
java.util.List<java.lang.Object> |
getAllValues(java.lang.String attributeName)
Returns all values of a selected attribute
|
java.util.Optional<java.lang.Object> |
getFirstValue(java.lang.String attributeName)
Returns the value of the first occurrence of an attribute
|
<T> java.util.Optional<T> |
getFirstValue(java.lang.String attributeName,
java.lang.Class<T> clazz)
Returns the value of the first occurrence of an attribute
|
java.lang.String |
getName()
Return the name of the annotation
|
public void addAttribute(java.lang.String attributeName, java.lang.Object value)
attributeName
- value
- public java.lang.String getName()
public java.util.Optional<java.lang.Object> getFirstValue(java.lang.String attributeName)
attributeName
- public <T> java.util.Optional<T> getFirstValue(java.lang.String attributeName, java.lang.Class<T> clazz)
attributeName
- public java.util.List<java.lang.Object> getAllValues(java.lang.String attributeName)
attributeName
- public void forEachValue(java.util.function.BiConsumer<java.lang.String,java.lang.Object> consumer)
public java.util.Set<java.lang.String> getAllAttributeNames()