Class Smashed


  • public final class Smashed
    extends java.lang.Object
    Smashed will generate a simplified string, used to determine if all inputs are of the same form. Smashed strings follow the following rules: - Strings of length greater than SMASHED_MAX are replaced with .+ - any digit is replaced with '9' - any low alpha (a-f, A-F) is replaced with 'x' - any high alpha (g-z, G-Z) is replaced with 'X' - any % is sloshed (i.e. replaced with %%)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String smash​(java.lang.String input)
      Fast method to simplify a string so that we can determine if all inputs are of the same form.
      static java.lang.String smashedAsRegExp​(java.lang.String smashed)
      Generate a Regular Expression from the 'smashed' input.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • smash

        public static java.lang.String smash​(java.lang.String input)
        Fast method to simplify a string so that we can determine if all inputs are of the same form.
        Parameters:
        input - The input String to be smashed.
        Returns:
        A 'smashed' String.
      • smashedAsRegExp

        public static java.lang.String smashedAsRegExp​(java.lang.String smashed)
        Generate a Regular Expression from the 'smashed' input.
        Parameters:
        smashed - The smashed input
        Returns:
        A Regular Expression that captures the 'smashed' input.