Record Class ParsedParameters

java.lang.Object
java.lang.Record
io.github.connellite.jdbc.parser.ParsedParameters

public record ParsedParameters(boolean positional, List<String> parameterNames) extends Record
  • Field Details

  • Constructor Details

    • ParsedParameters

      public ParsedParameters(boolean positional, List<String> parameterNames)
      Creates an instance of a ParsedParameters record class.
      Parameters:
      positional - the value for the positional record component
      parameterNames - the value for the parameterNames record component
  • Method Details

    • getParameterCount

      public int getParameterCount()
    • named

      public static ParsedParameters named(List<String> names)
      Static factory of named parsed parameters. Input names must be bare names without SQL prefix characters.
      Parameters:
      names - parameter names from SQL
      Returns:
      new named parsed parameters
      Throws:
      IllegalArgumentException - when names contain positional marker

      Jdbi reference: https://github.com/jdbi/jdbi/blob/6e959ba70365fb0e15f19f39e8b2bf32d4998b6c/core/src/main/java/org/jdbi/v3/core/statement/ParsedParameters.java

    • positional

      public static ParsedParameters positional(int count)
      Static factory of positional parsed parameters.
      Parameters:
      count - number of positional parameters in SQL
      Returns:
      new positional parsed parameters

      Jdbi reference: https://github.com/jdbi/jdbi/blob/6e959ba70365fb0e15f19f39e8b2bf32d4998b6c/core/src/main/java/org/jdbi/v3/core/statement/ParsedParameters.java

    • toString

      public final 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.
    • positional

      public boolean positional()
      Returns the value of the positional record component.
      Returns:
      the value of the positional record component
    • parameterNames

      public List<String> parameterNames()
      Returns the value of the parameterNames record component.
      Returns:
      the value of the parameterNames record component