java.lang.Object
org.tentackle.persist.NormText
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.
It is intended to search in normtext columns of PDOs with LIKE or NOT LIKE.
- Author:
- harald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the search pattern ready to be used in a LIKE expression.booleanReturns whether the pattern should be interpreted as "NOT LIKE".booleanReturns whether the pattern matches all.
-
Constructor Details
-
NormText
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 Details
-
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
-