Record Class Tm1Capability

java.lang.Object
java.lang.Record
io.skipcheck.tm1.client.version.Tm1Capability
Record Components:
kind - what kind of element this is
type - the qualified type it belongs to (a bound operation's binding type, a property's structured type), or null
name - the element's name: an entity set or singleton name, a qualified operation name, or a property name
addedIn - the schema version that added it, or null if not known

public record Tm1Capability(Tm1Capability.Kind kind, @Nullable String type, String name, @Nullable String addedIn) extends Record
Something a request needs the server to define in its $metadata: an entity set, a singleton, an operation or a property. A request can declare one, and the session checks it against the connected server before sending anything.
// Does the server's $metadata define the cube's tm1.Reserve action?
Tm1Capability reserve = Tm1Capability.boundOperation("tm1.Cube", "tm1.Reserve").since("11.8.34");
return session.capabilities().map(capabilities -> capabilities.supports(reserve));

Names are qualified by namespace or alias (tm1.Cube or ibm.tm1.api.v1.Cube), as in $metadata. since(String) records the schema version that added it, from Core.Revisions, so a server that lacks it can be told why; the generated model fills it in.

  • Constructor Details

  • Method Details

    • entitySet

      public static Tm1Capability entitySet(String name)
      An entity set.
      Parameters:
      name - its name, such as GitPlans
      Returns:
      the capability
    • singleton

      public static Tm1Capability singleton(String name)
      A singleton.
      Parameters:
      name - its name, such as ActiveSession
      Returns:
      the capability
    • boundOperation

      public static Tm1Capability boundOperation(String bindingType, String operation)
      An action or function bound to a type, or to one of its base types.
      Parameters:
      bindingType - the qualified type, such as tm1.Cube
      operation - the qualified operation name, such as tm1.Reserve
      Returns:
      the capability
    • unboundOperation

      public static Tm1Capability unboundOperation(String name)
      An action or function import, invoked from the service root.
      Parameters:
      name - the import's name, such as ExecuteMDX
      Returns:
      the capability
    • property

      public static Tm1Capability property(String type, String property)
      A structural or navigation property of a type, or of one of its base types.
      Parameters:
      type - the qualified type, such as tm1.Cube
      property - the property's name, such as Rules
      Returns:
      the capability
    • since

      public Tm1Capability since(String schemaVersion)
      A copy recording the schema version that added it.
      Parameters:
      schemaVersion - the version from Core.Revisions, such as 11.8.34
      Returns:
      the copy
    • addedInVersion

      public Optional<String> addedInVersion()
      The schema version that added it.
      Returns:
      the version, or empty if not known
    • describe

      public String describe()
      How it reads in messages, with aliases and namespaces dropped: Cube.Reserve, entity set GitPlans.
      Returns:
      the description
    • 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.
    • kind

      public Tm1Capability.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • type

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

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • addedIn

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