java.lang.Object
org.litebridgedb.db.spi.Row
- All Implemented Interfaces:
Result
A row of data returned by a query. Holds a collection of column-value pairs.
This class provides methods to add columns with associated values, retrieve specific columns, and stream through all columns in the row.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classA combination of a column and its associated value within a row. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve a column from the row by its name if it exists.columnForAlias(String alias) Retrieve a column from the row by its name if it exists.Return a stream ofRow.RowColumnobjects, each representing a column in the current row along with its associated value.intsize()Returns the total number of columns in the current row.toString()withColumn(Column column, @Nullable Object value) Add a new column-value pair to the row and return the updated instance.
-
Constructor Details
-
Row
public Row()
-
-
Method Details
-
withColumn
Add a new column-value pair to the row and return the updated instance.If the column already exists, its value will be replaced with the new value provided.
- Parameters:
column- the column to add or update within the row; must not be nullvalue- the value associated with the specified column; may be null- Returns:
- the updated
Rowinstance with the new column-value pair added
-
columnStream
Return a stream ofRow.RowColumnobjects, each representing a column in the current row along with its associated value.- Returns:
- a stream of
RowColumnobjects for all columns in the row
-
column
Retrieve a column from the row by its name if it exists.- Parameters:
column- the name of the column to retrieve; must not be null- Returns:
- an
Optionalcontaining theRowColumnassociated with the specified column name if it exists, or an emptyOptionalif no match is found
-
columnForAlias
Retrieve a column from the row by its name if it exists.- Parameters:
alias- the alias of the column to retrieve; must not be null- Returns:
- an
Optionalcontaining theRowColumnassociated with the specified column name if it exists, or an emptyOptionalif no match is found
-
column
-
size
public int size()Returns the total number of columns in the current row.- Returns:
- the size of the column collection for the row
-
toString
-