Class ParsedParameters


  • public final class ParsedParameters
    extends java.lang.Object
    The parsed parameters from an SQL statement.
    • Field Detail

      • positional

        private final boolean positional
      • parameterNames

        private final java.util.List<java.lang.String> parameterNames
    • Constructor Detail

      • ParsedParameters

        ParsedParameters​(boolean positional,
                         java.util.List<java.lang.String> parameterNames)
    • Method Detail

      • isPositional

        public boolean isPositional()
        Whether the the SQL statement uses positional parameters. False means that the statement either uses named parameters, or has no parameters at all.
        Returns:
        true if the statemetnt uses positional parameters.
      • getParameterCount

        public int getParameterCount()
        The number of parameters from the SQL statement.
        Returns:
        the number of parameters from the SQL statement.
      • getParameterNames

        public java.util.List<java.lang.String> getParameterNames()
        The parameter names from the SQL statement.
        Returns:
        the parameter names from the SQL statement.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • named

        public static ParsedParameters named​(java.util.List<java.lang.String> names)
        A static factory of named ParsedParameters instances. List given in argument must contain parameter names from the related statement. They must be bare names, free of SQL variable processing syntax such as a prefixed colon or other delimiters.
        Parameters:
        names - the parameter names from SQL statement
        Returns:
        New ParsedParameters instance
        Throws:
        java.lang.IllegalArgumentException - if names list contains positional parameter
      • positional

        public static ParsedParameters positional​(int count)
        A static factory of positional ParsedParameters instances. The count given in the argument must indicate how many positional parameters are available in the statement.
        Parameters:
        count - the number of positional parameters in statement
        Returns:
        New ParsedParameters instance