Record Class CsdlTypeRef

java.lang.Object
java.lang.Record
io.skipcheck.tm1.csdl.CsdlTypeRef
Record Components:
name - the type's qualified name, without Collection(...)
collection - whether it's a collection of that type

public record CsdlTypeRef(String name, boolean collection) extends Record
A reference to a type, as written in a Type attribute: Edm.String, tm1.Element, or Collection(tm1.Element).
  • Constructor Details

    • CsdlTypeRef

      public CsdlTypeRef(String name, boolean collection)
      Validates the components.
  • Method Details

    • parse

      public static CsdlTypeRef parse(String text)
      Parses a Type attribute.
      Parameters:
      text - the attribute's value, e.g. Collection(tm1.Element); surrounding whitespace is ignored
      Returns:
      the type reference
    • isPrimitive

      public boolean isPrimitive()
      True for the built-in Edm.* types.
      Returns:
      true if the type's name starts with Edm.
    • toString

      public String toString()
      The type as written in CSDL, e.g. Collection(tm1.Element).
      Specified by:
      toString in class Record
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • name

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

      public boolean collection()
      Returns the value of the collection record component.
      Returns:
      the value of the collection record component