Interface ComparableLiteral<V extends Comparable<?>>
- Type Parameters:
V- entity attribute type.
- All Superinterfaces:
ComparableExpression<Object,,V> Expression<Object,,V> Literal<V>
- All Known Subinterfaces:
BooleanLiteral,NumericLiteral<N>,StringLiteral,TemporalLiteral<V>
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComparableLiteral<Character> of(char value) Create aComparableLiteralrepresenting the givenchar.static ComparableLiteral<UUID> Create aComparableLiteralrepresenting the givenUUID.static <V extends Comparable<?>>
ComparableLiteral<V> of(V value) Creates aComparableLiteralor subtype ofComparableLiteralthat represents the given value.toString()Returns aStringrepresenting the literal 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, type
-
Method Details
-
of
Creates a
ComparableLiteralor subtype ofComparableLiteralthat represents the given value.The most specific subtype of
ComparableLiteral, such asNumericLiteral,StringLiteral, orTemporalLiteral, should be used instead wherever possible.- Type Parameters:
V- entity attribute type.- Parameters:
value- an immutable value or a mutable value that must never be modified after it is supplied to this method. Must never benull.- Returns:
- a
ComparableLiteralrepresenting the value. - Throws:
NullPointerException- if the value isnull.
-
of
Create aComparableLiteralrepresenting the givenchar. -
of
Create aComparableLiteralrepresenting the givenUUID. -
toString
String toString()Returns a
Stringrepresenting the literal value.Subtypes of
ComparableLiteraloverride this method to define more specific formats that more closely align with query language.If the value is of type
Boolean, this method outputsTRUEforBoolean.TRUEandFALSEforBoolean.FALSE.If the value is of type
Character, this method outputs aStringthat consists of the character enclosed in single quotes. If the character is the single quote character, an additional single quote character is included to escape it.If the value is an enumeration type, this method outputs the fully qualified class name of the type, followed by the
.character, followed by the name of the enumeration element to which the value is assigned.For all other types, this method outputs a
Stringthat begins 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 isComparableLiteral. 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
ComparableLiteral.of(Month.MAY).toString()isjava.time.Month.MAY
For example, the output of
ComparableLiteral.of('D').toString()is'D'
The output of
ComparableLiteral.of(UUID.fromString("73d518c4-b7f6-4c3b-9f63-60a045a43bb8")).toString()is{ComparableLiteral java.util.UUID '73d518c4-b7f6-4c3b-9f63-60a045a43bb8'}
-