Module jakarta.data
Interface NumericLiteral<N extends Number & Comparable<N>>
- Type Parameters:
N- entity attribute type.
- All Superinterfaces:
ComparableExpression<Object,,N> ComparableLiteral<N>,Expression<Object,,N> Literal<N>,NumericExpression<Object,N>
public interface NumericLiteral<N extends Number & Comparable<N>>
extends ComparableLiteral<N>, NumericExpression<Object,N>
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic NumericLiteral<Byte> of(byte value) Create aNumericLiteralrepresenting the givenbyte.static NumericLiteral<Double> of(double value) Create aNumericLiteralrepresenting the givendouble.static NumericLiteral<Float> of(float value) Create aNumericLiteralrepresenting the givenfloat.static NumericLiteral<Integer> of(int value) Create aNumericLiteralrepresenting the givenint.static NumericLiteral<Long> of(long value) Create aNumericLiteralrepresenting the givenlong.static NumericLiteral<Short> of(short value) Create aNumericLiteralrepresenting the givenshort.static <N extends Number & Comparable<N>>
NumericLiteral<N> Creates aNumericLiteralthat represents the given value.static NumericLiteral<BigDecimal> of(BigDecimal value) Create aNumericLiteralrepresenting the givenBigDecimal.static NumericLiteral<BigInteger> of(BigInteger value) Create aNumericLiteralrepresenting the givenBigInteger.toString()Returns aStringrepresenting the literal numeric value.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
-
of
Creates a
NumericLiteralthat represents the given value.- Type Parameters:
N- entity attribute type.- Parameters:
value- an immutable numeric value. Must never benull.- Returns:
- a
NumericLiteralrepresenting the value. - Throws:
NullPointerException- if the value isnull.
-
of
Create aNumericLiteralrepresenting the givenint. -
of
Create aNumericLiteralrepresenting the givenlong. -
of
Create aNumericLiteralrepresenting the givenfloat. -
of
Create aNumericLiteralrepresenting the givendouble. -
of
Create aNumericLiteralrepresenting the givenbyte. -
of
Create aNumericLiteralrepresenting the givenshort. -
of
Create aNumericLiteralrepresenting the givenBigInteger. -
of
Create aNumericLiteralrepresenting the givenBigDecimal. -
toString
String toString()Returns a
Stringrepresenting the literal numeric value.For the following types, the
Stringconsists of the numeric value, followed byLforLong,FforFloat,DforDouble,BIforBigInteger, orBDforBigDecimal.
For values of type
Integer, theStringconsists of the numeric value without any suffix.For all other types, the
Stringbegins with an opening curly brace and ends with a closing curly brace. Between the braces are 3 terms delimited by a space character. The first term isNumericLiteral. The second term is the fully qualified class name of the value's type. The third term is thetoString()output of the value, enclosed in single quotes.For example, the output of
NumericLiteral.of(BigDecimal.valueOf(123456789, 2)).toString()is1234567.89BD
- Specified by:
toStringin interfaceComparableLiteral<N extends Number & Comparable<N>>- Specified by:
toStringin interfaceLiteral<N extends Number & Comparable<N>>- Overrides:
toStringin classObject- Returns:
- a
Stringrepresenting the literal numeric value.
-