- All Known Implementing Classes:
RecordOperationsImpl
public sealed interface RecordOperations<R extends Record> permits RecordOperationsImpl<R>
A builder for an operation containers that maps operations to record components.
Note that all operations added to this builder are performed lazily,
i.e. they will only be validated when needed. An RecordResolveException
will only be thrown when the operations are performed and
the specified record component can not be resolved.
-
Method Summary
Modifier and Type Method Description <T> RecordOperations<R>add(LambdaSupport.WrappedFunction<R,T> component, UnaryOperator<T> operation)Adds a new operation to a record component.<T> LambdaSupport.WrappedFunction<R,T>all()Returns a component identifier that indicates that an operation should be performed on all record components.<T> RecordOperations<R>check(LambdaSupport.WrappedFunction<R,T> component, Predicate<T> toCheck)Adds a new operation to a record component that verifies if a given predicate is true.<T> RecordOperations<R>notNull(LambdaSupport.WrappedFunction<R,T> component)Adds a new operation to a record component that verifies that the input is not null.
-
Method Details
-
add
<T> RecordOperations<R> add(LambdaSupport.WrappedFunction<R,T> component, UnaryOperator<T> operation)Adds a new operation to a record component.- Parameters:
component- the record componentoperation- the operation that should be performed- Throws:
NullPointerException- if any argument is null
-
notNull
Adds a new operation to a record component that verifies that the input is not null.- Parameters:
component- the record component- Throws:
NullPointerException- ifcomponentis null
-
check
Adds a new operation to a record component that verifies if a given predicate is true.- Parameters:
component- the record component- Throws:
NullPointerException- ifcomponentis null
-
all
Returns a component identifier that indicates that an operation should be performed on all record components.
-