javax.mail.search
Class RecipientStringTerm

java.lang.Object
  extended by javax.mail.search.SearchTerm
      extended by javax.mail.search.StringTerm
          extended by javax.mail.search.AddressStringTerm
              extended by javax.mail.search.RecipientStringTerm
All Implemented Interfaces:
java.io.Serializable

public final class RecipientStringTerm
extends AddressStringTerm

A string comparison of the recipient headers in a message.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.mail.search.StringTerm
ignoreCase, pattern
 
Constructor Summary
RecipientStringTerm(Message.RecipientType type, java.lang.String pattern)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 Message.RecipientType getRecipientType()
          Return the recipient type.
 int hashCode()
           
 boolean match(Message msg)
          Returns true only if the address specified in this term is a substring of the recipient address in the given message.
 
Methods inherited from class javax.mail.search.AddressStringTerm
match
 
Methods inherited from class javax.mail.search.StringTerm
getIgnoreCase, getPattern, match
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecipientStringTerm

public RecipientStringTerm(Message.RecipientType type,
                           java.lang.String pattern)
Constructor.

Parameters:
type - the recipient type
address - the address pattern for comparison
Method Detail

getRecipientType

public Message.RecipientType getRecipientType()
Return the recipient type.


match

public boolean match(Message msg)
Returns true only if the address specified in this term is a substring of the recipient address in the given message.

Specified by:
match in class SearchTerm

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class AddressStringTerm

hashCode

public int hashCode()
Overrides:
hashCode in class StringTerm