Record Class Range.Bounded<A>
java.lang.Object
java.lang.Record
io.codemine.java.postgresql.codecs.Range.Bounded<A>
- Record Components:
lower- the lower bound value, ornullfor negative infinitylowerInclusive-trueif the lower bound is inclusive ([); ignored whenlowerisnullupper- the upper bound value, ornullfor positive infinityupperInclusive-trueif the upper bound is inclusive (]); ignored whenupperisnull
- All Implemented Interfaces:
Range<A>
public static record Range.Bounded<A>(A lower, boolean lowerInclusive, A upper, boolean upperInclusive)
extends Record
implements Range<A>
A bounded range with explicit bound inclusivity.
Infinite bounds (null) are always exclusive: if lower is null then
lowerInclusive is normalised to false, and likewise for upper.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.codemine.java.postgresql.codecs.Range
Range.Bounded<A>, Range.Empty<A> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.lower()Returns the value of thelowerrecord component.booleanReturns the value of thelowerInclusiverecord component.toString()Returns a string representation of this record class.upper()Returns the value of theupperrecord component.booleanReturns the value of theupperInclusiverecord component.
-
Constructor Details
-
Bounded
Creates an instance of aBoundedrecord class.- Parameters:
lower- the value for thelowerrecord componentlowerInclusive- the value for thelowerInclusiverecord componentupper- the value for theupperrecord componentupperInclusive- the value for theupperInclusiverecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
lower
Returns the value of thelowerrecord component.- Returns:
- the value of the
lowerrecord component
-
lowerInclusive
public boolean lowerInclusive()Returns the value of thelowerInclusiverecord component.- Returns:
- the value of the
lowerInclusiverecord component
-
upper
Returns the value of theupperrecord component.- Returns:
- the value of the
upperrecord component
-
upperInclusive
public boolean upperInclusive()Returns the value of theupperInclusiverecord component.- Returns:
- the value of the
upperInclusiverecord component
-