Class EPSGCodeFinder.Condition

java.lang.Object
org.apache.sis.referencing.factory.sql.EPSGCodeFinder.Condition
Direct Known Subclasses:
EPSGCodeFinder.FloatCondition
Enclosing class:
EPSGCodeFinder

private static class EPSGCodeFinder.Condition extends Object
A condition to put in a SQL WHERE clause. SQL query will be one of the forms shown below, where <column> and <values> are column and values respectively. The latter form is used if <filters> is a floating point value. Otherwise, <filters> are typically EPSG codes of dependencies.
  • Field Details

    • NAME

      static final EPSGCodeFinder.Condition NAME
      A sentinel value for filtering by name.
    • column

      final String column
      The column on which the condition apply.
    • values

      final Set<Number> values
      The values of the conditions.
  • Constructor Details

    • Condition

      Condition(String column, Set<Number> values)
      Creates a new condition.
  • Method Details

    • appendToWhere

      boolean appendToWhere(StringBuilder buffer, boolean isNext)
      Appends this condition into the given buffer. If isNext is true, then an "AND" keyword is appended before the condition. Otherwise this method presumes that the given buffer already ends with "WHERE " or "AND " keyword. This method does not append a new "AND" keyword after the condition.
      Parameters:
      buffer - where to append the SQL fragment.
      isNext - whether to append a "AND" keyword before the condition.
      Returns:
      whether a SQL fragment has been appended.
    • appendToOrderBy

      void appendToOrderBy(StringBuilder buffer)
      Appends an ordering criterion. The buffer shall ends with "ORDER BY" keyword before this method is invoked. If this method appends a criterion, then a comma will be appended after that criterion for allowing chaining.
      Parameters:
      buffer - where to append the SQL fragment.
    • toString

      public final String toString()
      Returns a string representation of this condition for debugging purpose.
      Overrides:
      toString in class Object