Top Description Fields Constructors Methods
jakarta.mail.search

public final Class FromStringTerm

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

This class implements string comparisons for the From Address header.

Note that this class differs from the FromTerm 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

Constructor Summary

AccessConstructor and Description
public
FromStringTerm(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 boolean

Returns:

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

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

Check whether the address string specified in the constructor is a substring of the From 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.

Constructor Detail

FromStringTermback to summary
public FromStringTerm(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.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
matchback to summary
public boolean match(Message msg)

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

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

Parameters
msg:Message

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

Returns:boolean

true if the match succeeds, otherwise false.

Annotations
@Override