Class NormText


  • public class NormText
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      NormText​(java.lang.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).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getPattern()
      Gets the search pattern ready to be used in a LIKE expression.
      boolean isInverted()
      Returns whether the pattern should be interpreted as "NOT LIKE".
      boolean isMatchingAll()
      Returns whether the pattern matches all.
      • Methods inherited from class java.lang.Object

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

      • NormText

        public NormText​(java.lang.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 java.lang.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