- java.lang.Object
-
- org.tentackle.persist.NormText
-
public class NormText extends java.lang.ObjectA 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 viaStringHelper.normalize(java.lang.String).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetPattern()Gets the search pattern ready to be used in a LIKE expression.booleanisInverted()Returns whether the pattern should be interpreted as "NOT LIKE".booleanisMatchingAll()Returns whether the pattern matches all.
-
-
-
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 viaStringHelper.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
-
-