Package io.github.connellite.jdbc.parser
Record Class ParsedParameters
java.lang.Object
java.lang.Record
io.github.connellite.jdbc.parser.ParsedParameters
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParsedParameters(boolean positional, List<String> parameterNames) Creates an instance of aParsedParametersrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intfinal inthashCode()Returns a hash code value for this object.static ParsedParametersStatic factory of named parsed parameters.Returns the value of theparameterNamesrecord component.booleanReturns the value of thepositionalrecord component.static ParsedParameterspositional(int count) Static factory of positional parsed parameters.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
-
-
Constructor Details
-
ParsedParameters
Creates an instance of aParsedParametersrecord class.- Parameters:
positional- the value for thepositionalrecord componentparameterNames- the value for theparameterNamesrecord component
-
-
Method Details
-
getParameterCount
public int getParameterCount() -
named
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 markerJdbi reference: https://github.com/jdbi/jdbi/blob/6e959ba70365fb0e15f19f39e8b2bf32d4998b6c/core/src/main/java/org/jdbi/v3/core/statement/ParsedParameters.java
-
positional
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
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 '=='. -
positional
public boolean positional()Returns the value of thepositionalrecord component.- Returns:
- the value of the
positionalrecord component
-
parameterNames
Returns the value of theparameterNamesrecord component.- Returns:
- the value of the
parameterNamesrecord component
-