T - the type of the field valuepublic class DefaultCondition<T>
extends java.lang.Object
It contains a DslField to get the value from the model, a PredicateMetadata to describe this node,
and a BiFunction to take the value from the model and return an optional value.
| Modifier and Type | Field and Description |
|---|---|
protected DslField |
field |
protected java.util.function.BiFunction<DslModel,Context,java.util.Optional<N>> |
function |
protected PredicateMetadata |
metadata |
protected java.util.function.BiFunction<DslModel,DslField,java.util.Optional<N>> |
value |
| Constructor and Description |
|---|
DefaultCondition(DslField field) |
DefaultCondition(DslField field,
PredicateMetadata metadata,
java.util.function.BiFunction<DslModel,Context,java.util.Optional<T>> value) |
| Modifier and Type | Method and Description |
|---|---|
StepCondition |
allMatch(java.util.Collection<T> values)
Returns a step condition checking if the node value matches all of the given values.
|
StepCondition |
allMatch(java.util.List<java.util.function.Predicate<T>> values)
Returns a step condition checking if all of the given predicates testing the node value match.
|
StepCondition |
allMatch(T... values)
Returns a step condition checking if the node value matches all of the given values.
|
StepCondition |
anyMatch(java.util.Collection<T> values)
Returns a step condition checking if the node value matches any of the given values.
|
StepCondition |
anyMatch(java.util.List<java.util.function.Predicate<T>> values)
Returns a step condition checking if any of the given predicates testing the node value match.
|
StepCondition |
anyMatch(T... values)
Returns a step condition checking if the node value matches any of the given values.
|
StepCondition |
eq(BaseFieldInfo<T> value)
Returns a step condition checking if the node value is equal to the given supplier value.
|
StepCondition |
eq(DefaultCondition<T> value)
Returns a step condition checking if the node value is not equal to the given condition.
|
StepCondition |
eq(java.util.function.Supplier<T> value)
Returns a step condition checking if the node value is equal to the given field value.
|
StepCondition |
eq(T value)
Returns a step condition checking if the node value is equal to the given value.
|
PredicateMetadata |
getMetadata() |
StepCondition |
isNotNull()
Returns a step condition checking if the node value is not null.
|
StepCondition |
isNull()
Returns a step condition checking if the node value is null.
|
IntegerCondition |
mapToInt(java.util.function.Function<T,java.lang.Integer> mapper)
Returns an integer step condition that returns the node value mapped by the given mapper.
|
StepCondition |
noneMatch(java.util.Collection<T> values)
Returns a step condition checking if the node value matches none of the given values.
|
StepCondition |
noneMatch(java.util.List<java.util.function.Predicate<T>> values)
Returns a step condition checking if none of the given predicates testing the node value match.
|
StepCondition |
noneMatch(T... values)
Returns a step condition checking if the node value matches none of the given values.
|
StepCondition |
notEq(BaseFieldInfo<T> value)
Returns a step condition checking if the node value is not equal to the given field value.
|
StepCondition |
notEq(DefaultCondition<T> value)
Returns a step condition checking if the node value is not equal to the given condition.
|
StepCondition |
notEq(java.util.function.Supplier<T> value)
Returns a step condition checking if the node value is not equal to the given supplier value.
|
StepCondition |
notEq(T value)
Returns a step condition checking if the node value is not equal to the given value.
|
protected StepCondition |
predicate(LeafMetadata metadata,
java.util.function.BiFunction<DslModel,Context,java.util.Optional<N>> value,
java.util.function.BiFunction<N,N,java.lang.Boolean> predicate) |
protected StepCondition |
predicate(LeafMetadata metadata,
java.util.function.Function<N,java.lang.Boolean> predicate) |
java.lang.String |
readable()
Returns the human readable version of this object.
|
protected java.util.Optional<N> |
value(DslModel model,
DslField field) |
protected java.util.Optional<N> |
valueModel(DslModel model,
DslField field) |
protected final DslField field
protected final PredicateMetadata metadata
public DefaultCondition(DslField field)
public DefaultCondition(DslField field, PredicateMetadata metadata, java.util.function.BiFunction<DslModel,Context,java.util.Optional<T>> value)
public final StepCondition isNull()
public final StepCondition isNotNull()
public final StepCondition eq(T value)
value - the right side valuepublic final StepCondition eq(java.util.function.Supplier<T> value)
value - the right side valuepublic final StepCondition eq(BaseFieldInfo<T> value)
value - the right side valuepublic final StepCondition eq(DefaultCondition<T> value)
value - the right side valuepublic final StepCondition notEq(T value)
value - the right side valuepublic final StepCondition notEq(java.util.function.Supplier<T> value)
value - the right side valuepublic final StepCondition notEq(BaseFieldInfo<T> value)
value - the right side valuepublic final StepCondition notEq(DefaultCondition<T> value)
value - the right side value@SafeVarargs public final StepCondition anyMatch(T... values)
values - the values to matchpublic final StepCondition anyMatch(java.util.Collection<T> values)
values - the values to matchpublic final StepCondition anyMatch(java.util.List<java.util.function.Predicate<T>> values)
values - the values to match@SafeVarargs public final StepCondition allMatch(T... values)
values - the values to matchpublic final StepCondition allMatch(java.util.Collection<T> values)
values - the values to matchpublic final StepCondition allMatch(java.util.List<java.util.function.Predicate<T>> values)
values - the values to match@SafeVarargs public final StepCondition noneMatch(T... values)
values - the values to matchpublic final StepCondition noneMatch(java.util.Collection<T> values)
values - the values to matchpublic final StepCondition noneMatch(java.util.List<java.util.function.Predicate<T>> values)
values - the values to matchpublic final IntegerCondition mapToInt(java.util.function.Function<T,java.lang.Integer> mapper)
mapper - the to integer mapper to applyprotected final StepCondition predicate(LeafMetadata metadata, java.util.function.Function<N,java.lang.Boolean> predicate)
protected final StepCondition predicate(LeafMetadata metadata, java.util.function.BiFunction<DslModel,Context,java.util.Optional<N>> value, java.util.function.BiFunction<N,N,java.lang.Boolean> predicate)
public PredicateMetadata getMetadata()