inet.ipaddr.format.util.sql

Interface IPAddressSQLTranslator

  • All Known Implementing Classes:
    MySQLTranslator


    public interface IPAddressSQLTranslator
    Used to produce SQL for matching ip address section strings in databases. Provides SQL conditions using SQL targeting a given database type.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      java.lang.StringBuilder boundSeparatorCount(java.lang.StringBuilder builder, java.lang.String expression, char separator, int separatorCount)
      Produces an SQL condition that evaluates to true when "expression" has at most a certain number of a given char within, appending the condition to the given string builder.
      java.lang.StringBuilder matchSeparatorCount(java.lang.StringBuilder builder, java.lang.String expression, char separator, int separatorCount)
      Produces an SQL condition that evaluates to true when "expression" has exactly a certain number of a given char within, appending the condition to the given string builder.
      java.lang.StringBuilder matchString(java.lang.StringBuilder builder, java.lang.String expression, java.lang.String match)
      Produces an SQL condition that evaluates to true when the given expression matches the given String, appending the condition to the given string builder.
      java.lang.StringBuilder matchSubString(java.lang.StringBuilder builder, java.lang.String expression, char separator, int separatorCount, java.lang.String match)
      Produces an SQL condition that evaluates to true when the given expression matches a substring obtained from the given expression, appending the condition to the given string builder.
      void setNetwork(java.lang.String networkString)
      Called with the network section, taken from an IP address or IP address section, that is being matched, for logging or debugging purposes.
    • Method Detail

      • setNetwork

        void setNetwork(java.lang.String networkString)
        Called with the network section, taken from an IP address or IP address section, that is being matched, for logging or debugging purposes.
        Parameters:
        networkString -
      • matchString

        java.lang.StringBuilder matchString(java.lang.StringBuilder builder,
                                            java.lang.String expression,
                                            java.lang.String match)
        Produces an SQL condition that evaluates to true when the given expression matches the given String, appending the condition to the given string builder.
        Parameters:
        builder -
        expression - the expression
        match - the String to match with the expression
        Returns:
        builder with the condition appended
      • matchSubString

        java.lang.StringBuilder matchSubString(java.lang.StringBuilder builder,
                                               java.lang.String expression,
                                               char separator,
                                               int separatorCount,
                                               java.lang.String match)
        Produces an SQL condition that evaluates to true when the given expression matches a substring obtained from the given expression, appending the condition to the given string builder.
        Parameters:
        builder -
        expression - the expression
        match - the String to match with a substring of the expression, the substring being the substring taken from "expression" prior to the separatorCount appearance of the given separator char. If there are not that many appearances of the separator char, then the substring is all of the String expression.
        Returns:
        builder with the condition appended
      • matchSeparatorCount

        java.lang.StringBuilder matchSeparatorCount(java.lang.StringBuilder builder,
                                                    java.lang.String expression,
                                                    char separator,
                                                    int separatorCount)
        Produces an SQL condition that evaluates to true when "expression" has exactly a certain number of a given char within, appending the condition to the given string builder.
        Parameters:
        builder -
        expression - the expression which must contain the indicated count of the indicated separator char
        separator - the separator char
        separatorCount - the count to match
        Returns:
        builder with the condition appended
      • boundSeparatorCount

        java.lang.StringBuilder boundSeparatorCount(java.lang.StringBuilder builder,
                                                    java.lang.String expression,
                                                    char separator,
                                                    int separatorCount)
        Produces an SQL condition that evaluates to true when "expression" has at most a certain number of a given char within, appending the condition to the given string builder.
        Parameters:
        builder -
        expression - the expression which must contain at most the indicated count of the indicated separator char
        separator - the separator char
        separatorCount - the count to match
        Returns:
        builder with the condition appended