Record Class RowColumn

java.lang.Object
java.lang.Record
org.litebridge.db.spi.RowColumn
Record Components:
label - The label or alias that identifies this column in a row; must not be null.
value - The optional value associated with this column; may be null if no value is present.
column - An optional reference to the Column defining this column's metadata; can be null.
tableAlias - The optional table alias associated with this column; can be null.

public record RowColumn(String label, @Nullable Object value, @Nullable Column column, @Nullable String tableAlias) extends Record
A column within a row of a database query result.

The column is defined by a label, a nullablel value, and an optional reference to a Column instance. The label acts as the unique identifier or alias for the column in the row, while the value holds the data associated with the column at runtime.

This class is immutable and designed to be part of the Row class, which represents a collection of such columns within a single row of query results.

  • Constructor Details

    • RowColumn

      public RowColumn(String label, @Nullable Object value, @Nullable Column column)
    • RowColumn

      public RowColumn(String label, @Nullable Object value, @Nullable Column column, @Nullable String tableAlias)
      Creates an instance of a RowColumn record class.
      Parameters:
      label - the value for the label record component
      value - the value for the value record component
      column - the value for the column record component
      tableAlias - the value for the tableAlias record component
  • Method Details

    • structureHashCode

      public int structureHashCode()
      Computes a structural hash code for this column based strictly on its label, table alias, and column metadata (name and table), ignoring the runtime value.
      Returns:
      the structural hash code of this row column
    • toString

      public 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.
    • label

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

      public @Nullable Object value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • column

      public @Nullable Column column()
      Returns the value of the column record component.
      Returns:
      the value of the column record component
    • tableAlias

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