public class PropertyDynamicPerformerBuilder<T> extends AbstractDynamicPerformerBuilder<T,CompositeComparisonPerformer<T>>
Class provides functionality to build a CompositeComparisonPerformer by specifying actual properties
of a class to be compared. All specified properties are mapped by the specific property key. Result performer
contains delegating performers for each specified property.
Properties specified in the form of the ClassProperty instances. Each property should relate to the
class specified in the constructor.
Note: registered properties are stored in a map, so you cannot register multiple instances for the same property key.
This builder implements AbstractDynamicPerformerBuilder, so it provides all the
DynamicComparisonPerformer functionality. Check out documentation for the parent class.
| Constructor and Description |
|---|
PropertyDynamicPerformerBuilder(java.lang.Class<T> type) |
| Modifier and Type | Method and Description |
|---|---|
<V> PropertyDynamicPerformerBuilder<T> |
addProperty(ClassProperty<V,T> property)
Add specified property to the builder.
|
<V> PropertyDynamicPerformerBuilder<T> |
addProperty(ClassProperty<V,T> property,
ComparisonPerformer<? super V> delegate)
Add specified property to the builder.
|
<V> PropertyDynamicPerformerBuilder<T> |
addProperty(java.lang.String name,
java.util.function.Function<T,V> getter)
Instance of the
FunctionalClassProperty will be created from the specified function, and stored
in the builder. |
<V> PropertyDynamicPerformerBuilder<T> |
addProperty(java.lang.String name,
java.util.function.Function<T,V> getter,
ComparisonPerformer<? super V> performer)
Instance of the
FunctionalClassProperty will be created from the specified function, and stored
in the builder. |
CompositeComparisonPerformer<T> |
build(java.lang.String name) |
java.util.Map<ClassPropertyKey,ComparisonPerformer<T>> |
getPropertyPerformers() |
configureDynamicPerformer, getDynamicPerformer, getTypepublic PropertyDynamicPerformerBuilder(java.lang.Class<T> type)
public java.util.Map<ClassPropertyKey,ComparisonPerformer<T>> getPropertyPerformers()
public <V> PropertyDynamicPerformerBuilder<T> addProperty(java.lang.String name, java.util.function.Function<T,V> getter)
Instance of the FunctionalClassProperty will be created from the specified function, and stored
in the builder. Property key will be created from the specified name and result of the AbstractDynamicPerformerBuilder.getType()
method.
Default DynamicComparisonPerformer will be used to perform comparison for the property.
public <V> PropertyDynamicPerformerBuilder<T> addProperty(ClassProperty<V,T> property)
Add specified property to the builder. ClassProperty.getKey() will be used to retrieve property
key and map specified property.
Default DynamicComparisonPerformer will be used to perform comparison for the property.
public <V> PropertyDynamicPerformerBuilder<T> addProperty(java.lang.String name, java.util.function.Function<T,V> getter, ComparisonPerformer<? super V> performer)
Instance of the FunctionalClassProperty will be created from the specified function, and stored
in the builder. Property key will be created from the specified name and result of the AbstractDynamicPerformerBuilder.getType()
method.
Specified performer guaranteed to be used to perform comparison for the property.
public <V> PropertyDynamicPerformerBuilder<T> addProperty(ClassProperty<V,T> property, ComparisonPerformer<? super V> delegate)
Add specified property to the builder. ClassProperty.getKey() will be used to retrieve property
key and map specified property.
Specified performer guaranteed to be used to perform comparison for the property.
public CompositeComparisonPerformer<T> build(java.lang.String name)
build in class AbstractDynamicPerformerBuilder<T,CompositeComparisonPerformer<T>>