java.lang.Object
tools.refinery.interpreter.matchers.psystem.annotations.PAnnotation

public class PAnnotation extends Object
A container describing query annotations
  • Constructor Details

    • PAnnotation

      public PAnnotation(String name)
  • Method Details

    • addAttribute

      public void addAttribute(String attributeName, Object value)
      Adds an attribute to the annotation
      Parameters:
      attributeName -
      value -
    • getName

      public String getName()
      Return the name of the annotation
    • getFirstValue

      public Optional<Object> getFirstValue(String attributeName)
      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

      public <T> Optional<T> getFirstValue(String attributeName, Class<T> clazz)
      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

      public List<Object> getAllValues(String attributeName)
      Returns all values of a selected attribute
      Parameters:
      attributeName -
      Returns:
      a non-null, but possibly empty list of attributes
    • forEachValue

      public void forEachValue(BiConsumer<String,Object> consumer)
      Executes a consumer over all attributes. A selected attribute name (key) can appear (and thus consumed) multiple times.
      Since:
      2.0
    • getAllAttributeNames

      public Set<String> getAllAttributeNames()
      Returns a set of all attribute names used in this annotation
      Since:
      2.1