java.lang.Object
java.lang.Record
org.litebridgedb.orm.persistence.PipedStatement
- Record Components:
statementBuilder- The statement builder to be used for building the dependency statement.dto- The DTO associated with the statement.valuePipe- The consumer for handling theUpdateResultgenerated by executing the statement.
public record PipedStatement(StatementBuilder<?> statementBuilder, Object dto, Consumer<UpdateResult> valuePipe)
extends Record
A statement in the context of dependent database operations that is built using an
AbstractStatementBuilder and optionally pipes result values using a Consumer.
This class is intended to encapsulate the process of preparing and managing a dependency of another database statement, associating an optional consumer for handling update results.
The class uses the following components:
- AbstractStatementBuilder: Responsible for building the database statement.
- Consumer: Handles the UpdateResult generated by executing the statement.
The primary constructor takes both a statement builder and a consumer for processing update results. An additional constructor allows for creating an instance with a default no-op consumer.
-
Constructor Summary
ConstructorsConstructorDescriptionPipedStatement(StatementBuilder<?> statementBuilder, Object dto) Constructs a newPipedStatementusing the givenAbstractStatementBuilder.PipedStatement(StatementBuilder<?> statementBuilder, Object dto, Consumer<UpdateResult> valuePipe) Creates an instance of aPipedStatementrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondto()Returns the value of thedtorecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thestatementBuilderrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thevaluePiperecord component.
-
Constructor Details
-
PipedStatement
Constructs a newPipedStatementusing the givenAbstractStatementBuilder.This constructor creates a piped statement with a default no-op consumer for handling update results.
- Parameters:
statementBuilder- The statement builder to be used for building the dependency statement.
-
PipedStatement
public PipedStatement(StatementBuilder<?> statementBuilder, Object dto, Consumer<UpdateResult> valuePipe) Creates an instance of aPipedStatementrecord class.- Parameters:
statementBuilder- the value for thestatementBuilderrecord componentdto- the value for thedtorecord componentvaluePipe- the value for thevaluePiperecord component
-
-
Method Details
-
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). -
statementBuilder
Returns the value of thestatementBuilderrecord component.- Returns:
- the value of the
statementBuilderrecord component
-
dto
Returns the value of thedtorecord component.- Returns:
- the value of the
dtorecord component
-
valuePipe
Returns the value of thevaluePiperecord component.- Returns:
- the value of the
valuePiperecord component
-