Interface TemporalLiteral<V extends Temporal & Comparable<? extends Temporal>>
- Type Parameters:
V- entity attribute type.
- All Superinterfaces:
ComparableExpression<Object,,V> ComparableLiteral<V>,Expression<Object,,V> Literal<V>,TemporalExpression<Object,V>
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V extends Temporal & Comparable<? extends Temporal>>
TemporalLiteral<V> Creates aTemporalLiteralthat represents the given value.static TemporalLiteral<Instant> Create aTemporalLiteralrepresenting the givenInstant.static TemporalLiteral<LocalDate> Create aTemporalLiteralrepresenting the givenLocalDate.static TemporalLiteral<LocalDateTime> of(LocalDateTime value) Create aTemporalLiteralrepresenting the givenLocalDateTime.static TemporalLiteral<LocalTime> Create aTemporalLiteralrepresenting the givenLocalTime.static TemporalLiteral<Year> Create aTemporalLiteralrepresenting the givenYear.toString()Returns aStringrepresenting the literal temporal 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
static <V extends Temporal & Comparable<? extends Temporal>> TemporalLiteral<V> of(Class<V> type, V value) Creates a
TemporalLiteralthat represents the given value.- Type Parameters:
V- entity attribute type.- Parameters:
value- an immutable temporal value. Must never benull.- Returns:
- a
TemporalLiteralrepresenting the value. - Throws:
NullPointerException- if the value isnull.
-
of
Create aTemporalLiteralrepresenting the givenInstant. -
of
Create aTemporalLiteralrepresenting the givenLocalDateTime. -
of
Create aTemporalLiteralrepresenting the givenLocalDate. -
of
Create aTemporalLiteralrepresenting the givenLocalTime. -
of
Create aTemporalLiteralrepresenting the givenYear. -
toString
String toString()Returns a
Stringrepresenting the literal temporal value. TheStringbegins with an opening curly brace and ends with a closing curly brace. Between the braces are 2 or 3 terms delimited by a space character. The first term istsforInstantandLocalDateTime,dforLocalDateandYear,tforLocalTime, orTemporalLiteralfor all other types, in which case a middle term is included. The middle term is the fully qualified class name of the value's type.
For
Instant, the final term is theLocalDateandLocalTimecomponents of theInstantinUTC, delimited by a space character and enclosed in single quotes.For
LocalDateTime, the final term is theLocalDateandLocalTimecomponents delimited by a space character and enclosed in single quotes.For all other types, the final term is the
toString()output of the value enclosed in single quotes.For example, the output of
TemporalLiteral.of(LocalDate.of(2025, 5, 8)).toString()is{d '2025-05-08'}The output of
TemporalLiteral.of(LocalDateTime.of(2025, 5, 9, 16, 25, 52)).toString()is{ts '2025-05-09 16:25:52'}- Specified by:
toStringin interfaceComparableLiteral<V extends Temporal & Comparable<? extends Temporal>>- Specified by:
toStringin interfaceLiteral<V extends Temporal & Comparable<? extends Temporal>>- Overrides:
toStringin classObject- Returns:
- a
Stringrepresenting the literal temporal value.
-