Record Class CsdlAnnotation

java.lang.Object
java.lang.Record
io.skipcheck.tm1.csdl.CsdlAnnotation
Record Components:
term - the term as written, e.g. Core.Revisions
qualifier - the qualifier, or null
value - the value

public record CsdlAnnotation(String term, @Nullable String qualifier, CsdlValue value) extends Record
A CSDL annotation: a vocabulary term applied to a model element, such as Core.Description or Core.Revisions.
  • Constructor Details

    • CsdlAnnotation

      public CsdlAnnotation(String term, @Nullable String qualifier, CsdlValue value)
      Validates the components.
  • Method Details

    • find

      public static Optional<CsdlAnnotation> find(List<CsdlAnnotation> annotations, String term)
      The first annotation with this term (ignoring qualifiers), if any.
      Parameters:
      annotations - the annotations to search
      term - the term as written, e.g. Core.Revisions
      Returns:
      the first matching annotation, or empty if none has the term
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • term

      public String term()
      Returns the value of the term record component.
      Returns:
      the value of the term record component
    • qualifier

      public @Nullable String qualifier()
      Returns the value of the qualifier record component.
      Returns:
      the value of the qualifier record component
    • value

      public CsdlValue value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component