Package javax.mail.search
Class StringTerm
java.lang.Object
javax.mail.search.SearchTerm
javax.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
Methods inherited from class javax.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
Return the string to match with.- Returns:
- the string to match
-
getIgnoreCase
public boolean getIgnoreCase()Return true if we should ignore case when matching.- Returns:
- true if we should ignore case
-
match
-
equals
Equality comparison. -
hashCode
public int hashCode()Compute a hashCode for this object.
-