java.lang.Object
jakarta.mail.search.SearchTerm
jakarta.mail.search.StringTerm
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AddressStringTerm
,BodyTerm
,HeaderTerm
,MessageIDTerm
,SubjectTerm
This class implements the match method for Strings. The current
implementation provides only for substring matching. We
could add comparisons (like strcmp ...).
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Ignore case when comparing?protected String
The pattern. -
Constructor Summary
ModifierConstructorDescriptionprotected
StringTerm
(String pattern) Construct a StringTerm with the given pattern.protected
StringTerm
(String pattern, boolean ignoreCase) Construct a StringTerm with the given pattern and ignoreCase flag. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Equality comparison.boolean
Return true if we should ignore case when matching.Return the string to match with.int
hashCode()
Compute a hashCode for this object.protected boolean
The match method.Methods inherited from class jakarta.mail.search.SearchTerm
match
-
Field Details
-
pattern
The pattern. -
ignoreCase
protected boolean ignoreCaseIgnore case when comparing?
-
-
Constructor Details
-
StringTerm
Construct a StringTerm with the given pattern. Case will be ignored.- Parameters:
pattern
- the pattern
-
StringTerm
Construct a StringTerm with the given pattern and ignoreCase flag.- Parameters:
pattern
- the patternignoreCase
- should we ignore case?
-
-
Method Details
-
getPattern
-
getIgnoreCase
public boolean getIgnoreCase()Return true if we should ignore case when matching.- Returns:
- true if we should ignore case
-
match
The match method.- Parameters:
s
- The pattern search is applied on given String- Returns:
- true if given string matches this pattern; otherwise false
-
equals
-
hashCode
-