Module inet.ipaddr

Class MySQLTranslator

java.lang.Object
inet.ipaddr.format.util.sql.MySQLTranslator
All Implemented Interfaces:
IPAddressSQLTranslator

public class MySQLTranslator extends Object implements IPAddressSQLTranslator
Author:
sfoley
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boundSeparatorCount(StringBuilder builder, 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.
    matchSeparatorCount(StringBuilder builder, 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.
    matchString(StringBuilder builder, String expression, 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.
    matchSubString(StringBuilder builder, String expression, char separator, int separatorCount, 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(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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MySQLTranslator

      public MySQLTranslator()
  • Method Details

    • setNetwork

      public void setNetwork(String networkString)
      Description copied from interface: IPAddressSQLTranslator
      Called with the network section, taken from an IP address or IP address section, that is being matched, for logging or debugging purposes.
      Specified by:
      setNetwork in interface IPAddressSQLTranslator
      Parameters:
      networkString -
    • matchString

      public StringBuilder matchString(StringBuilder builder, String expression, String match)
      Description copied from interface: IPAddressSQLTranslator
      Produces an SQL condition that evaluates to true when the given expression matches the given String, appending the condition to the given string builder.
      Specified by:
      matchString in interface IPAddressSQLTranslator
      Parameters:
      builder -
      expression - the expression
      match - the String to match with the expression
      Returns:
      builder with the condition appended
    • matchSubString

      public StringBuilder matchSubString(StringBuilder builder, String expression, char separator, int separatorCount, String match)
      Description copied from interface: IPAddressSQLTranslator
      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.
      Specified by:
      matchSubString in interface IPAddressSQLTranslator
      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

      public StringBuilder matchSeparatorCount(StringBuilder builder, String expression, char separator, int separatorCount)
      Description copied from interface: IPAddressSQLTranslator
      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.
      Specified by:
      matchSeparatorCount in interface IPAddressSQLTranslator
      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

      public StringBuilder boundSeparatorCount(StringBuilder builder, String expression, char separator, int separatorCount)
      Description copied from interface: IPAddressSQLTranslator
      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.
      Specified by:
      boundSeparatorCount in interface IPAddressSQLTranslator
      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