N - the type of the field valuepublic abstract class NumericCondition<N extends java.lang.Number> extends DefaultCondition<N>
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 |
| Modifier and Type | Method and Description |
|---|---|
StepCondition |
between(N minIncluded,
N maxExcluded)
Returns a step condition checking if the node value is between the given min included and max
excluded values.
|
StepCondition |
between(NumericFieldInfo<N> minIncluded,
NumericFieldInfo<N> maxExcluded)
Returns a step condition checking if the node value is between the given min included and max
excluded field values.
|
PredicateMetadata |
getMetadata() |
StepCondition |
greaterOrEquals(N value)
Returns a step condition checking if the node value is greater or equals the given value.
|
StepCondition |
greaterOrEquals(NumericFieldInfo<N> value)
Returns a step condition checking if the node value is greater or equals the given field value.
|
StepCondition |
greaterThan(N value)
Returns a step condition checking if the node value is greater than the given value.
|
StepCondition |
greaterThan(NumericFieldInfo<N> value)
Returns a step condition checking if the node value is greater than the given field value.
|
StepCondition |
lesserOrEquals(N value)
Returns a step condition checking if the node value is lesser or equals the given value.
|
StepCondition |
lesserOrEquals(NumericFieldInfo<N> value)
Returns a step condition checking if the node value is lesser or equals the given field value.
|
StepCondition |
lesserThan(N value)
Returns a step condition checking if the node value is lesser than the given value.
|
StepCondition |
lesserThan(NumericFieldInfo<N> value)
Returns a step condition checking if the node value is lesser than the given field value.
|
NumericCondition<N> |
min(java.util.List<NumericFieldInfo<N>> fields)
Returns a numeric step condition that returns the min value of the given field values.
|
protected abstract NumericCondition<N> |
numericCondition(DslField field,
PredicateMetadata metadata,
java.util.function.BiFunction<DslModel,Context,java.util.Optional<N>> 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.
|
NumericCondition<N> |
sum(java.util.List<NumericFieldInfo<N>> fields)
Returns a numeric step condition that returns the sum value of the given field values.
|
NumericCondition<N> |
sumConditions(java.util.List<NumericCondition<N>> conditions)
Returns a numeric step condition that returns the sum value of the given condition values.
|
NumericCondition<N> |
times(int multiplier)
Returns a numeric step condition that returns the node value multiplied by the given multiplier.
|
protected java.util.Optional<N> |
value(DslModel model,
DslField field) |
protected java.util.Optional<N> |
valueModel(DslModel model,
DslField field) |
NumericCondition<N> |
when(StepCondition condition)
Returns a numeric step condition that returns the node value if the condition evaluates to true.
|
protected final DslField field
protected final PredicateMetadata metadata
protected abstract NumericCondition<N> numericCondition(DslField field, PredicateMetadata metadata, java.util.function.BiFunction<DslModel,Context,java.util.Optional<N>> value)
public final StepCondition lesserThan(N value)
value - the right side valuepublic final StepCondition lesserThan(NumericFieldInfo<N> value)
value - the right side valuepublic final StepCondition lesserOrEquals(N value)
value - the right side valuepublic final StepCondition lesserOrEquals(NumericFieldInfo<N> value)
value - the right side valuepublic final StepCondition greaterThan(N value)
value - the right side valuepublic final StepCondition greaterThan(NumericFieldInfo<N> value)
value - the right side valuepublic final StepCondition greaterOrEquals(N value)
value - the right side valuepublic final StepCondition greaterOrEquals(NumericFieldInfo<N> value)
value - the right side valuepublic final StepCondition between(N minIncluded, N maxExcluded)
minIncluded - the min value includedmaxExcluded - the max value excludedpublic final StepCondition between(NumericFieldInfo<N> minIncluded, NumericFieldInfo<N> maxExcluded)
minIncluded - the min value includedmaxExcluded - the max value excludedpublic final NumericCondition<N> min(java.util.List<NumericFieldInfo<N>> fields)
fields - the field values to minimizepublic final NumericCondition<N> sum(java.util.List<NumericFieldInfo<N>> fields)
fields - the field values to sumpublic final NumericCondition<N> sumConditions(java.util.List<NumericCondition<N>> conditions)
conditions - the condition values to sumpublic final NumericCondition<N> times(int multiplier)
multiplier - the multiplierpublic final NumericCondition<N> when(StepCondition condition)
condition - the condition to testprotected 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()