Class PAnnotation
java.lang.Object
tools.refinery.interpreter.matchers.psystem.annotations.PAnnotation
A container describing query annotations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String attributeName, Object value) Adds an attribute to the annotationvoid
forEachValue
(BiConsumer<String, Object> consumer) Executes a consumer over all attributes.Returns a set of all attribute names used in this annotationgetAllValues
(String attributeName) Returns all values of a selected attributegetFirstValue
(String attributeName) Returns the value of the first occurrence of an attribute<T> Optional
<T> getFirstValue
(String attributeName, Class<T> clazz) Returns the value of the first occurrence of an attributegetName()
Return the name of the annotation
-
Constructor Details
-
PAnnotation
-
-
Method Details
-
addAttribute
Adds an attribute to the annotation- Parameters:
attributeName
-value
-
-
getName
Return the name of the annotation -
getFirstValue
Returns the value of the first occurrence of an attribute- Parameters:
attributeName
-- Returns:
- the attribute value, or null, if attribute is not available
- Since:
- 2.0
-
getFirstValue
Returns the value of the first occurrence of an attribute- Parameters:
attributeName
-- Returns:
- the attribute value, or null, if attribute is not available
- Since:
- 2.0
-
getAllValues
Returns all values of a selected attribute- Parameters:
attributeName
-- Returns:
- a non-null, but possibly empty list of attributes
-
forEachValue
Executes a consumer over all attributes. A selected attribute name (key) can appear (and thus consumed) multiple times.- Since:
- 2.0
-
getAllAttributeNames
Returns a set of all attribute names used in this annotation- Since:
- 2.1
-