Class NormText


  • public class NormText
    extends Object
    A helper class to create a normtext like string from a user's input.
    It is intended to search in normtext columns of PDOs with LIKE or NOT LIKE.
    Author:
    harald
    • Constructor Detail

      • NormText

        public NormText​(String str)
        Creates a normtext from a search string.
        This is usually a user input.
        The input will be normalized via StringHelper.normalize(java.lang.String). If the string starts with a "!" or "-" it will be treated as "NOT LIKE".
        Parameters:
        str - the search string
    • Method Detail

      • getPattern

        public String getPattern()
        Gets the search pattern ready to be used in a LIKE expression.
        Returns:
        the pattern, null if isMatchingAll(), never empty
      • isMatchingAll

        public boolean isMatchingAll()
        Returns whether the pattern matches all.
        Returns:
        true if all
      • isInverted

        public boolean isInverted()
        Returns whether the pattern should be interpreted as "NOT LIKE".
        Returns:
        true if NOT LIKE, else LIKE