Interface ParameterProcessor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents a functional interface intended to handle parameter mapping for a
PreparedStatement. Implementations of this interface should provide the
necessary logic to configure parameter values on a prepared statement before execution.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault ParameterProcessorandThen(ParameterProcessor after) Returns a new processor that first executes this processor and then invokes the providedafterprocessor.static ParameterProcessorcombine(ParameterProcessor... processors) Combines all provided processors into a single processor executed in order.default ParameterProcessorcompose(ParameterProcessor before) Returns a new processor that first executes the providedbeforeprocessor and then invokes this processor.voidexecute(PreparedStatement statement) Executes a parameter setting operation on the providedPreparedStatement.static ParameterProcessornoop()Returns a ParameterProcessor that does nothing when executed.static ParameterProcessorof(ParameterProcessor processor) Returns the provided processor or a no-op processor if the provided value isnull.
-
Field Details
-
NO_OP
-
-
Method Details
-
execute
Executes a parameter setting operation on the providedPreparedStatement. Implementations should define the logic for mapping parameters to the prepared statement.- Parameters:
statement- ThePreparedStatementon which parameter mapping and execution logic is applied- Throws:
SQLException- If a database access error occurs
-
noop
Returns a ParameterProcessor that does nothing when executed.- Returns:
- A no-op ParameterProcessor
-
of
Returns the provided processor or a no-op processor if the provided value isnull.- Parameters:
processor- The processor to use- Returns:
- The supplied processor or a no-op processor if
null
-
andThen
Returns a new processor that first executes this processor and then invokes the providedafterprocessor.- Parameters:
after- The processor to execute after this processor completes- Returns:
- A composed processor that performs the chained operations
-
compose
Returns a new processor that first executes the providedbeforeprocessor and then invokes this processor.- Parameters:
before- The processor to execute before this processor- Returns:
- A composed processor that performs the chained operations
-
combine
Combines all provided processors into a single processor executed in order.- Parameters:
processors- The processors to compose- Returns:
- A composite processor executing each processor in sequence
-