Interface NumericOperatorExpression<T,N extends Number & Comparable<N>>
- Type Parameters:
T- entity type.N- result type of the numeric expression.
- All Superinterfaces:
ComparableExpression<T,,N> Expression<T,,N> NumericExpression<T,N>
A numeric expression that represents a binary operation, such as the addition or multiplication of two numeric expressions.
- Since:
- 1.1
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumArithmetic operations that can be performed by aNumericOperatorExpression. -
Method Summary
Modifier and TypeMethodDescriptionNumericExpression<? super T, N> left()The numeric expression to which the arithmeticoperator()is applied.static <T,N extends Number & Comparable<N>>
NumericOperatorExpression<T, N> of(NumericOperatorExpression.Operator operator, NumericExpression<T, N> left, NumericExpression<? super T, N> right) Creates aNumericOperatorExpressionthat represents the given arithmeticoperatorapplying the value represented by therightexpression to the value represented by theleftexpression.static <T,N extends Number & Comparable<N>>
NumericOperatorExpression<T, N> of(NumericOperatorExpression.Operator operator, NumericExpression<T, N> left, N right) Creates aNumericOperatorExpressionthat represents the given arithmeticoperatorapplying the givenrightvalue to the value represented by theleftexpression.static <T,N extends Number & Comparable<N>>
NumericOperatorExpression<T, N> of(NumericOperatorExpression.Operator operator, N left, NumericExpression<T, N> right) Creates aNumericOperatorExpressionthat represents the given arithmeticoperatorapplying the value represented by therightexpression to the givenleftvalue.operator()The type of arithmetic operation represented by this expression.NumericExpression<? super T, N> right()The numeric expression applied to theleft()expression by the arithmeticoperator().Methods inherited from interface jakarta.data.expression.ComparableExpression
between, between, greaterThan, greaterThan, greaterThanEqual, greaterThanEqual, lessThan, lessThan, lessThanEqual, lessThanEqual, notBetween, notBetweenMethods inherited from interface jakarta.data.expression.Expression
equalTo, equalTo, in, in, in, isNull, notEqualTo, notEqualTo, notIn, notIn, notIn, notNull, satisfies, typeMethods inherited from interface jakarta.data.expression.NumericExpression
abs, asBigDecimal, asBigInteger, asDouble, asLong, dividedBy, dividedBy, dividedInto, minus, minus, negated, plus, plus, subtractedFrom, times, times
-
Method Details
-
left
NumericExpression<? super T,N> left()The numeric expression to which the arithmetic
operator()is applied.For example, the left expression is the minuend when the operation is subtraction,
difference = left() - right()
The left expression is the dividend when the operation is division,
quotient = left() / right()
- Returns:
- the numeric expression to which the operator is applied.
-
operator
NumericOperatorExpression.Operator operator()The type of arithmetic operation represented by this expression.
- Returns:
- one of the enumerated
Operatorvalues.
-
right
NumericExpression<? super T,N> right()The numeric expression applied to the
left()expression by the arithmeticoperator().For example, the right expression is the subtrahend when the operation is subtraction,
difference = left() - right()
The right expression is the divisor when the operation is division,
quotient = left() / right()
- Returns:
- the numeric expression applied to the
left()expression by the arithmetic operator.
-
of
static <T,N extends Number & Comparable<N>> NumericOperatorExpression<T,N> of(NumericOperatorExpression.Operator operator, N left, NumericExpression<T, N> right) Creates a
NumericOperatorExpressionthat represents the given arithmeticoperatorapplying the value represented by therightexpression to the givenleftvalue.- Type Parameters:
T- entity type.N- type of theleftvalue,rightexpression, and result expression.- Parameters:
operator- one of the enumeratedOperatorvalues.left- value to which theoperatoris applied.right- expression that represents the value applied by theoperatorto theleftvalue.- Returns:
- a numeric expression representing the result of the operation.
- Throws:
NullPointerException- if any of the method arguments arenull.
-
of
static <T,N extends Number & Comparable<N>> NumericOperatorExpression<T,N> of(NumericOperatorExpression.Operator operator, NumericExpression<T, N> left, N right) Creates a
NumericOperatorExpressionthat represents the given arithmeticoperatorapplying the givenrightvalue to the value represented by theleftexpression.- Type Parameters:
T- entity type.N- type of theleftexpression,rightvalue, and result expression.- Parameters:
operator- one of the enumeratedOperatorvalues.left- expression to which theoperatoris applied.right- value applied by theoperatorto theleftexpression.- Returns:
- a numeric expression representing the result of the operation.
- Throws:
NullPointerException- if any of the method arguments arenull.
-
of
static <T,N extends Number & Comparable<N>> NumericOperatorExpression<T,N> of(NumericOperatorExpression.Operator operator, NumericExpression<T, N> left, NumericExpression<? super T, N> right) Creates a
NumericOperatorExpressionthat represents the given arithmeticoperatorapplying the value represented by therightexpression to the value represented by theleftexpression.- Type Parameters:
T- entity type.N- type of theleftexpression,rightexpression, and result expression.- Parameters:
operator- one of the enumeratedOperatorvalues.left- expression to which theoperatoris applied.right- expression that represents the value applied by theoperatorto theleftexpression.- Returns:
- a numeric expression representing the result of the operation.
- Throws:
NullPointerException- if any of the method arguments arenull.
-