N - the type of the field valuepublic abstract class NumericFunction<N extends java.lang.Number> extends DefaultFunction<N,PredicateMetadata> implements NumericOperators<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.
function, metadata| Constructor and Description |
|---|
NumericFunction(PredicateMetadata metadata,
java.util.function.BiFunction<FieldModel,Context,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.
|
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.
|
NumericFunction<N> |
min(java.util.List<NumericFieldInfo<N>> fields)
Returns a numeric function that returns the min value of the given field values.
|
NumericFunction<N> |
minus(N value)
Returns a numeric function that returns the node value sum with the node value param.
|
NumericFunction<N> |
minus(NumericFieldInfo<N> field)
Returns a numeric function that returns the node value sum with the node value param.
|
NumericFunction<N> |
minus(NumericFunction<N> numericFunction)
Returns a numeric function that returns the node value sum with the node value param.
|
protected abstract NumericFunction<N> |
numericFunction(PredicateMetadata metadata,
java.util.function.BiFunction<FieldModel,Context,java.util.Optional<N>> value) |
NumericFunction<N> |
plus(N value)
Returns a numeric function that returns the node value sum with the node value param.
|
NumericFunction<N> |
plus(NumericFieldInfo<N> field)
Returns a numeric function that returns the node value sum with the node value param.
|
NumericFunction<N> |
plus(NumericFunction<N> numericFunction)
Returns a numeric function that returns the node value sum with the node value param.
|
NumericFunction<N> |
sum(java.util.List<NumericFieldInfo<N>> fields)
Returns a numeric function that returns the sum value of the given field values.
|
NumericFunction<N> |
sumConditions(java.util.List<NumericFunction<N>> conditions)
Returns a numeric function that returns the sum value of the given condition values.
|
NumericFunction<N> |
times(int multiplier)
Returns a numeric function that returns the node value multiplied by the given multiplier.
|
NumericFunction<N> |
when(StepCondition condition)
Returns a numeric step condition that returns the node value if the condition evaluates to true.
|
allMatch, allMatch, allMatch, anyMatch, anyMatch, eq, eq, eq, getFunction, getMetadata, isNotNull, isNull, map, mapToInt, mapToString, mapUsing, noneMatch, noneMatch, noneMatch, notEq, notEq, notEq, position, readable, tags, valueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgreaterOrEqualsFunction, greaterThanFunction, identity, lesserOrEqualsFunction, lesserThanFunction, minFunction, minusFunction, sumFunction, timesFunctionisUsing, markdown, markdown, readablepublic NumericFunction(PredicateMetadata metadata, java.util.function.BiFunction<FieldModel,Context,java.util.Optional<N>> value)
protected abstract NumericFunction<N> numericFunction(PredicateMetadata metadata, java.util.function.BiFunction<FieldModel,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 NumericFunction<N> times(int multiplier)
multiplier - the multiplierpublic final NumericFunction<N> plus(NumericFieldInfo<N> field)
field - the field to sumpublic final NumericFunction<N> plus(N value)
value - to sumpublic final NumericFunction<N> plus(NumericFunction<N> numericFunction)
numericFunction - function to sumpublic final NumericFunction<N> minus(NumericFieldInfo<N> field)
field - the field to subtractpublic final NumericFunction<N> minus(N value)
value - to subtractpublic final NumericFunction<N> minus(NumericFunction<N> numericFunction)
numericFunction - function to subtractpublic final NumericFunction<N> min(java.util.List<NumericFieldInfo<N>> fields)
fields - the field values to minimizepublic final NumericFunction<N> sum(java.util.List<NumericFieldInfo<N>> fields)
fields - the field values to sumpublic final NumericFunction<N> sumConditions(java.util.List<NumericFunction<N>> conditions)
conditions - the condition values to sumpublic final NumericFunction<N> when(StepCondition condition)
condition - the condition to test