Record Class ArrayType

java.lang.Object
java.lang.Record
com.darkcollective.relix.symbol.ArrayType
Record Components:
element - the element type; must not be null
All Implemented Interfaces:
Type

public record ArrayType(Type element) extends Record implements Type
A nested array type — an ordered collection of elements of a single element type (which may itself be nested).

An array of heterogeneous or unknown elements is modelled as ArrayType(ScalarType.ANY), consistent with schema-on-read: the element type is then resolved per element at runtime.

  • Constructor Summary

    Constructors
    Constructor
    Description
    ArrayType(Type element)
    Creates an instance of a ArrayType record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    A compact, structurally-recursive type code used in the IR report and in machine-readable (JSON) output.
    A short, human-readable, structurally-recursive description of this type — e.g.
    Returns the value of the element record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ArrayType

      public ArrayType(Type element)
      Creates an instance of a ArrayType record class.
      Parameters:
      element - the value for the element record component
  • Method Details

    • display

      public String display()
      Description copied from interface: Type
      A short, human-readable, structurally-recursive description of this type — e.g. "number", "struct{id: number, tags: array<string>}", "array<number>".
      Specified by:
      display in interface Type
      Returns:
      the display string; never null or blank
    • code

      public String code()
      Description copied from interface: Type
      A compact, structurally-recursive type code used in the IR report and in machine-readable (JSON) output. Scalars are one letter (Number, String, Boolean, ?=any); an array is [elem] and a struct is {field:code,…} — e.g. [N], {id:N,tags:[S]}.
      Specified by:
      code in interface Type
      Returns:
      the compact type code; never null or blank
    • 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.
    • element

      public Type element()
      Returns the value of the element record component.
      Returns:
      the value of the element record component