Record Class CsdlRevision

java.lang.Object
java.lang.Record
io.skipcheck.tm1.csdl.CsdlRevision
Record Components:
version - the schema version, or null if the record has none
kind - the kind of revision
rawKind - the kind as written, e.g. Core.RevisionKind/Added, for kinds this client doesn't know
description - the reason given, or null

public record CsdlRevision(@Nullable String version, CsdlRevision.Kind kind, @Nullable String rawKind, @Nullable String description) extends Record
One record of a Core.Revisions annotation: the schema version in which a model element was added, modified or deprecated.

TM1 annotates most of its API this way, back to 10.2.2. The versions are schema versions (as in Core.SchemaVersion, e.g. 11.8.35), not server build numbers.

  • Field Details

  • Constructor Details

    • CsdlRevision

      public CsdlRevision(@Nullable String version, CsdlRevision.Kind kind, @Nullable String rawKind, @Nullable String description)
      Creates an instance of a CsdlRevision record class.
      Parameters:
      version - the value for the version record component
      kind - the value for the kind record component
      rawKind - the value for the rawKind record component
      description - the value for the description record component
  • Method Details

    • of

      public static List<CsdlRevision> of(List<CsdlAnnotation> annotations)
      Reads the Core.Revisions records from an element's annotations, in document order.
      Parameters:
      annotations - the element's annotations
      Returns:
      the revisions, or an empty list if there's no Core.Revisions collection
    • addedIn

      public static Optional<String> addedIn(List<CsdlAnnotation> annotations)
      The version this element was first added in, if its revisions say.
      Parameters:
      annotations - the element's annotations
      Returns:
      the schema version of the first Added revision with a version, or empty
    • deprecatedIn

      public static Optional<String> deprecatedIn(List<CsdlAnnotation> annotations)
      The version this element was deprecated in, if its revisions say.
      Parameters:
      annotations - the element's annotations
      Returns:
      the schema version of the first Deprecated revision with a version, or empty
    • 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.
    • version

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

      public CsdlRevision.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • rawKind

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

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