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, or null for negative infinity
lowerInclusive - true if the lower bound is inclusive ([); ignored when lower is null
upper - the upper bound value, or null for positive infinity
upperInclusive - true if the upper bound is inclusive (]); ignored when upper is null
All Implemented Interfaces:
Range<A>
Enclosing interface:
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
    Constructor
    Description
    Bounded(A lower, boolean lowerInclusive, A upper, boolean upperInclusive)
    Creates an instance of a Bounded record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the lower record component.
    boolean
    Returns the value of the lowerInclusive record component.
    Returns a string representation of this record class.
    Returns the value of the upper record component.
    boolean
    Returns the value of the upperInclusive record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Bounded

      public Bounded(A lower, boolean lowerInclusive, A upper, boolean upperInclusive)
      Creates an instance of a Bounded record class.
      Parameters:
      lower - the value for the lower record component
      lowerInclusive - the value for the lowerInclusive record component
      upper - the value for the upper record component
      upperInclusive - the value for the upperInclusive record component
  • Method Details

    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • lower

      public A lower()
      Returns the value of the lower record component.
      Returns:
      the value of the lower record component
    • lowerInclusive

      public boolean lowerInclusive()
      Returns the value of the lowerInclusive record component.
      Returns:
      the value of the lowerInclusive record component
    • upper

      public A upper()
      Returns the value of the upper record component.
      Returns:
      the value of the upper record component
    • upperInclusive

      public boolean upperInclusive()
      Returns the value of the upperInclusive record component.
      Returns:
      the value of the upperInclusive record component