Record Class WindowFrame.Bound

java.lang.Object
java.lang.Record
com.darkcollective.relix.ast.WindowFrame.Bound
Record Components:
kind - which end, in the order the kinds are declared; never null
offset - the distance, present exactly for PRECEDING and FOLLOWING: a non-negative number, or a duration
Enclosing interface:
WindowFrame

public static record WindowFrame.Bound(WindowFrame.Bound.Kind kind, Optional<Operand> offset) extends Record
One end of a WindowFrame.Between frame.
  • Constructor Details

  • Method Details

    • unboundedPreceding

      public static WindowFrame.Bound unboundedPreceding()
    • preceding

      public static WindowFrame.Bound preceding(Operand offset)
    • currentRow

      public static WindowFrame.Bound currentRow()
    • following

      public static WindowFrame.Bound following(Operand offset)
    • unboundedFollowing

      public static WindowFrame.Bound unboundedFollowing()
    • render

      public String render(Function<Operand,String> offsetText)
      The bound as SQL writes it, the offset printed by offsetText.
    • 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
    • literal

      public static String literal(Operand offset)
      A literal offset as written: a number, or DURATION '…'.
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • kind

      public WindowFrame.Bound.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • offset

      public Optional<Operand> offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component