T - the type of the field valuepublic class DefaultCondition<T> extends DefaultFunction<T,PredicateMetadata>
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.
function, metadata| Constructor and Description |
|---|
DefaultCondition(DslField<T> field) |
DefaultCondition(PredicateMetadata metadata,
java.util.function.BiFunction<FieldModel,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 |
eq(BaseFieldInfo<T> value)
Returns a step condition checking if the node value is equal to the given supplier value.
|
StepCondition |
eq(java.util.function.Supplier<T> supplier)
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.
|
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.
|
<R> DefaultCondition<R> |
map(java.lang.String readable,
java.util.function.Function<T,R> mapper)
Returns a default step condition that returns the node value mapped by the given function.
|
IntegerFunction |
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.
|
StringFunction |
mapToString(java.util.function.Function<T,java.lang.String> mapper)
Returns a string step condition that returns the node value mapped by the given function.
|
<U,R> DefaultCondition<R> |
mapUsing(java.lang.String readable,
Function<U> condition,
java.util.function.BiFunction<T,U,R> mapper)
Returns an default step condition that returns the node value mapped by the given function.
|
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(java.util.function.Supplier<T> supplier)
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.
|
getFunction, getMetadata, readable, value, valueModelpublic DefaultCondition(PredicateMetadata metadata, java.util.function.BiFunction<FieldModel,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> supplier)
supplier - the right side valuepublic final StepCondition eq(BaseFieldInfo<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> supplier)
supplier - the right side valuepublic final StepCondition notEq(BaseFieldInfo<T> value)
value - the right side valuepublic 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 IntegerFunction mapToInt(java.util.function.Function<T,java.lang.Integer> mapper)
mapper - the to integer mapper to applypublic final StringFunction mapToString(java.util.function.Function<T,java.lang.String> mapper)
mapper - function to string to applypublic final <R> DefaultCondition<R> map(java.lang.String readable, java.util.function.Function<T,R> mapper)
R - target typereadable - text describing the functionmapper - mapper function to applypublic final <U,R> DefaultCondition<R> mapUsing(java.lang.String readable, Function<U> condition, java.util.function.BiFunction<T,U,R> mapper)
U - condition typeR - target typereadable - descriptioncondition - conditionmapper - mapper function to apply