Interface Range<A>
- Type Parameters:
A- the element type of the range
- All Known Implementing Classes:
Range.Bounded,Range.Empty
PostgreSQL range type. Represents a range of values of type
A in the canonical
[lower, upper) form (inclusive lower, exclusive upper).
A range can be:
- Empty — no values are in the range
- Bounded — with an optional lower and/or upper bound. A
nulllower bound means negative infinity; anullupper bound means positive infinity.
The standard PostgreSQL range types are:
int4range—Range<Integer>int8range—Range<Long>numrange—Range<java.math.BigDecimal>tsrange—Range<java.time.LocalDateTime>tstzrange—Range<java.time.Instant>daterange—Range<java.time.LocalDate>
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA bounded range.static final recordAn empty range containing no values. -
Method Summary
Static Methods
-
Method Details
-
empty
Creates an empty range. -
bounded
Creates a bounded range with the given lower and upper bounds. -
unbounded
Creates an unbounded range (from negative infinity to positive infinity).
-