Record Class BindValueExpression

java.lang.Object
java.lang.Record
org.litebridge.db.spi.expression.BindValueExpression
Record Components:
index - the index of the bind value
size - the size of the bind value (e.g. for collection expressions)
All Implemented Interfaces:
SelectExpression

public record BindValueExpression(int index, int size) extends Record implements SelectExpression
An encapsulated literal value in a query expression.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BindValueExpression(int index, int size)
    Creates an instance of a BindValueExpression record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    int
    Returns the value of the index record component.
    int
    Returns the value of the size record component.
    toSql(Operation operation, ClauseType clause, @Nullable DelegateExpression parent)
    Creates a SQL representation of the expression, providing the immediate nesting/parent expression.
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.litebridge.db.spi.expression.SelectExpression

    toSql
  • Constructor Details

    • BindValueExpression

      public BindValueExpression(int index, int size)
      Creates an instance of a BindValueExpression record class.
      Parameters:
      index - the value for the index record component
      size - the value for the size record component
  • Method Details

    • toSql

      public String toSql(Operation operation, ClauseType clause, @Nullable DelegateExpression parent)
      Description copied from interface: SelectExpression
      Creates a SQL representation of the expression, providing the immediate nesting/parent expression.
      Specified by:
      toSql in interface SelectExpression
      Parameters:
      operation - the operation that is being executed
      clause - The current clause type being evaluated
      parent - The parent expression/nesting expression, or null if this is a top-level expression
      Returns:
      the SQL representation of the expression
    • equals

      public 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 '=='.
      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.
    • hashCode

      public 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
    • 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
    • index

      public int index()
      Returns the value of the index record component.
      Returns:
      the value of the index record component
    • size

      public int size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component