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 theColumndefining 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Columncolumn()Returns the value of thecolumnrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.label()Returns the value of thelabelrecord component.intComputes a structural hash code for this column based strictly on its label, table alias, and column metadata (name and table), ignoring the runtime value.@Nullable StringReturns the value of thetableAliasrecord component.toString()Returns a string representation of this record class.@Nullable Objectvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
RowColumn
-
RowColumn
public RowColumn(String label, @Nullable Object value, @Nullable Column column, @Nullable String tableAlias) Creates an instance of aRowColumnrecord class.- Parameters:
label- the value for thelabelrecord componentvalue- the value for thevaluerecord componentcolumn- the value for thecolumnrecord componenttableAlias- the value for thetableAliasrecord 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
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
column
Returns the value of thecolumnrecord component.- Returns:
- the value of the
columnrecord component
-
tableAlias
Returns the value of thetableAliasrecord component.- Returns:
- the value of the
tableAliasrecord component
-