Top Description Fields Constructors Methods
jakarta.mail.search

public final Class RecipientStringTerm

extends AddressStringTerm
Class Inheritance
Imports
jakarta.mail.Message, .Address

This class implements string comparisons for the Recipient Address headers.

Note that this class differs from the RecipientTerm class in that this class does comparisons on address strings rather than Address objects. The string comparisons are case-insensitive.

Since
JavaMail 1.1

Field Summary

Modifier and TypeField and Description
private static final long
private Message.RecipientType
type

The recipient type.

Constructor Summary

AccessConstructor and Description
public
RecipientStringTerm(Message.RecipientType
the recipient type
type
,
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.AddressStringTerm.equals.

Equality comparison.
public Message.RecipientType

Returns:

the recipient type
getRecipientType
()

Return the type of recipient to match with.

public int
hashCode()

Overrides jakarta.mail.search.StringTerm.hashCode.

Compute a hashCode for this object.
public boolean

Returns:

true if the match succeeds, otherwise false.
match
(Message
The comparison is applied to this Message's recipient address.
msg
)

Implements abstract jakarta.mail.search.SearchTerm.match.

Check whether the address specified in the constructor is a substring of the recipient address of this Message.
Inherited from jakarta.mail.search.AddressStringTerm:
match

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides jakarta.mail.search.AddressStringTerm.serialVersionUID.

typeback to summary
private Message.RecipientType type

The recipient type.

Constructor Detail

RecipientStringTermback to summary
public RecipientStringTerm(Message.RecipientType type, String pattern)

Constructor.

Parameters
type:Message.RecipientType

the recipient type

pattern:String

the address pattern to be compared.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides jakarta.mail.search.AddressStringTerm.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
getRecipientTypeback to summary
public Message.RecipientType getRecipientType()

Return the type of recipient to match with.

Returns:Message.RecipientType

the recipient type

hashCodeback to summary
public int hashCode()

Overrides jakarta.mail.search.StringTerm.hashCode.

Compute a hashCode for this object.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
matchback to summary
public boolean match(Message msg)

Implements abstract jakarta.mail.search.SearchTerm.match.

Check whether the address specified in the constructor is a substring of the recipient address of this Message.

Parameters
msg:Message

The comparison is applied to this Message's recipient address.

Returns:boolean

true if the match succeeds, otherwise false.

Annotations
@Override