Class NormText

java.lang.Object
org.tentackle.persist.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 Summary

    Constructors
    Constructor
    Description
    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

    Modifier and Type
    Method
    Description
    Gets the search pattern ready to be used in a LIKE expression.
    boolean
    Returns whether the pattern should be interpreted as "NOT LIKE".
    boolean
    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 Details

    • 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 Details

    • 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