Record Class QueryResult
java.lang.Object
java.lang.Record
com.darkcollective.relix.processor.internal.QueryResult
- Record Components:
label- display label for this result; never null or blankschema- the output schema; never nullrows- the result rows in order; never null; may be empty
The fully-materialised result of executing a single
query statement.
A QueryResult is produced by QueryExecutor for each
query statement in a relix script. It captures:
- a human-readable
labelsuitable for display headers; - the output
schema(column names and types); - the fully-materialised list of
rows.
Instances are immutable. The rows list is an unmodifiable copy.
For named queries (query MyRelation;), the label is the relation
name. For inline expression queries (query { π name (Users) };),
the label is "<expression N>" where N is the 1-based
position of the query in the script.
-
Constructor Summary
ConstructorsConstructorDescriptionQueryResult(String label, Schema schema, List<Row> rows) Creates an instance of aQueryResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()Returnstrueif this result contains no rows.label()Returns the value of thelabelrecord component.introwCount()Returns the number of rows in this result.rows()Returns the value of therowsrecord component.schema()Returns the value of theschemarecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
isEmpty
public boolean isEmpty()Returnstrueif this result contains no rows.- Returns:
truewhenrowsis empty
-
rowCount
public int rowCount()Returns the number of rows in this result.- Returns:
- the row count; never negative
-
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
-
schema
Returns the value of theschemarecord component.- Returns:
- the value of the
schemarecord component
-
rows
Returns the value of therowsrecord component.- Returns:
- the value of the
rowsrecord component
-