Top Description Fields Constructors Methods
jakarta.mail.search

public abstract Class AddressStringTerm

extends StringTerm
Class Inheritance
Known Direct Subclasses
jakarta.mail.search.FromStringTerm, jakarta.mail.search.RecipientStringTerm
Imports
jakarta.mail.Message, .Address, jakarta.mail.internet.InternetAddress

This abstract class implements string comparisons for Message addresses.

Note that this class differs from the AddressTerm class in that this class does comparisons on address strings rather than Address objects.

Since
JavaMail 1.1

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from jakarta.mail.search.StringTerm:
ignoreCasepattern

Constructor Summary

AccessConstructor and Description
protected
AddressStringTerm(String
the address pattern to be compared.
pattern
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides jakarta.mail.search.StringTerm.equals.

Equality comparison.
protected boolean

Returns:

true if the match succeeds, otherwise false.
match
(Address
The comparison is applied to this Address object.
a
)

Check whether the address pattern specified in the constructor is a substring of the string representation of the given Address object.

Inherited from jakarta.mail.search.StringTerm:
getIgnoreCasegetPatternhashCodematch

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides jakarta.mail.search.StringTerm.serialVersionUID.

Constructor Detail

AddressStringTermback to summary
protected AddressStringTerm(String pattern)

Constructor.

Parameters
pattern:String

the address pattern to be compared.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides jakarta.mail.search.StringTerm.equals.

Equality comparison.

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
matchback to summary
protected boolean match(Address a)

Check whether the address pattern specified in the constructor is a substring of the string representation of the given Address object.

Note that if the string representation of the given Address object contains charset or transfer encodings, the encodings must be accounted for, during the match process.

Parameters
a:Address

The comparison is applied to this Address object.

Returns:boolean

true if the match succeeds, otherwise false.