T
- A type that can be decorated, or transformed, through applying a function.@FunctionalInterface public interface ConditionalDecorator<T>
Modifier and Type | Method and Description |
---|---|
static <T> ConditionalDecorator<T> |
create(Predicate<T> predicate,
UnaryOperator<T> transform) |
static <T> T |
decorate(T initialValue,
List<ConditionalDecorator<T>> decorators)
This function will transform an initially supplied value with provided transforming, or decorating, functions that are
conditionally and sequentially applied.
|
default Predicate<T> |
predicate() |
UnaryOperator<T> |
transform() |
UnaryOperator<T> transform()
static <T> ConditionalDecorator<T> create(Predicate<T> predicate, UnaryOperator<T> transform)
static <T> T decorate(T initialValue, List<ConditionalDecorator<T>> decorators)
If the supplied collection is ordered, the function is guaranteed to apply the transforms in the order in which they appear in the collection.
T
- The type of the valueinitialValue
- The untransformed start valuedecorators
- A list of condition to transformCopyright © 2023. All rights reserved.