Package guru.mikelue.jdut.decorate
Class ReplaceFieldDataDecorator.Builder
- java.lang.Object
-
- guru.mikelue.jdut.decorate.ReplaceFieldDataDecorator.Builder
-
- Enclosing class:
- ReplaceFieldDataDecorator
public class ReplaceFieldDataDecorator.Builder extends Object
Used withbuildDataGrainDecorator(Consumer<ReplaceFieldDataDecorator.Builder>)
.
You could put multiple pair of
Predicate<DataField>
and replaceingValue, the first matched predicate would be choosed for replacement.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReplaceFieldDataDecorator.Builder
replaceWith(Object checkedObject, Object replacingValue)
Adds a replacement with checked value of replacing value.ReplaceFieldDataDecorator.Builder
replaceWith(Predicate<? super DataField<?>> dataFieldPredicate, Object replacingValue)
Adds a replacement withPredicate
of replacing value.
-
-
-
Method Detail
-
replaceWith
public ReplaceFieldDataDecorator.Builder replaceWith(Object checkedObject, Object replacingValue)
Adds a replacement with checked value of replacing value.The instance of replacingValue could be an instance of
Supplier
.- Parameters:
checkedObject
- Checked objectreplacingValue
- The value replacing old value- Returns:
- cascading self
-
replaceWith
public ReplaceFieldDataDecorator.Builder replaceWith(Predicate<? super DataField<?>> dataFieldPredicate, Object replacingValue)
Adds a replacement withPredicate
of replacing value.
The instance of replacingValue could be an instance of
Supplier
.- Parameters:
dataFieldPredicate
- The instance of predicationreplacingValue
- The value replacing old value- Returns:
- cascading self
-
-