- java.lang.Object
- 
- jakarta.mail.search.SearchTerm
- 
- jakarta.mail.search.StringTerm
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable
 - Direct Known Subclasses:
- AddressStringTerm,- BodyTerm,- HeaderTerm,- MessageIDTerm,- SubjectTerm
 
 public abstract class StringTerm extends SearchTerm This class implements the match method for Strings. The current implementation provides only for substring matching. We could add comparisons (like strcmp ...).- Author:
- Bill Shannon, John Mani
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected booleanignoreCaseIgnore case when comparing?protected java.lang.StringpatternThe pattern.
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedStringTerm(java.lang.String pattern)Construct a StringTerm with the given pattern.protectedStringTerm(java.lang.String pattern, boolean ignoreCase)Construct a StringTerm with the given pattern and ignoreCase flag.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Equality comparison.booleangetIgnoreCase()Return true if we should ignore case when matching.java.lang.StringgetPattern()Return the string to match with.inthashCode()Compute a hashCode for this object.protected booleanmatch(java.lang.String s)The match method.- 
Methods inherited from class jakarta.mail.search.SearchTermmatch
 
- 
 
- 
- 
- 
Constructor Detail- 
StringTermprotected StringTerm(java.lang.String pattern) Construct a StringTerm with the given pattern. Case will be ignored.- Parameters:
- pattern- the pattern
 
 - 
StringTermprotected StringTerm(java.lang.String pattern, boolean ignoreCase)Construct a StringTerm with the given pattern and ignoreCase flag.- Parameters:
- pattern- the pattern
- ignoreCase- should we ignore case?
 
 
- 
 - 
Method Detail- 
getPatternpublic java.lang.String getPattern() Return the string to match with.- Returns:
- the string to match
 
 - 
getIgnoreCasepublic boolean getIgnoreCase() Return true if we should ignore case when matching.- Returns:
- true if we should ignore case
 
 - 
matchprotected boolean match(java.lang.String s) The match method.- Parameters:
- s- The pattern search is applied on given String
- Returns:
- true if given string matches this pattern; otherwise false
 
 - 
equalspublic boolean equals(java.lang.Object obj) Equality comparison.- Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() Compute a hashCode for this object.- Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-