Top Description Fields Constructors Methods
javax.mail.search

public final Class HeaderTerm

extends StringTerm
Class Inheritance
Imports
java.util.Locale, javax.mail.Message

This class implements comparisons for Message headers. The comparison is case-insensitive.
Authors
Bill Shannon, John Mani

Field Summary

Modifier and TypeField and Description
private String
headerName

The name of the header.

private static final long
Inherited from javax.mail.search.StringTerm:
ignoreCasepattern

Constructor Summary

AccessConstructor and Description
public
HeaderTerm(String
The name of the header
headerName
,
String
The pattern to search for
pattern
)

Constructor.

Method Summary

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

Overrides javax.mail.search.StringTerm.equals.

Equality comparison.
public String

Returns:

the name of the header
getHeaderName
()

Return the name of the header to compare with.

public int
hashCode()

Overrides javax.mail.search.StringTerm.hashCode.

Compute a hashCode for this object.
public boolean

Returns:

true if the match succeeds, otherwise false
match
(Message
The match is applied to this Message's header
msg
)

Implements abstract javax.mail.search.SearchTerm.match.

The header match method.
Inherited from javax.mail.search.StringTerm:
getIgnoreCasegetPatternmatch

Field Detail

headerNameback to summary
private String headerName

The name of the header.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.mail.search.StringTerm.serialVersionUID.

Constructor Detail

HeaderTermback to summary
public HeaderTerm(String headerName, String pattern)

Constructor.

Parameters
headerName:String

The name of the header

pattern:String

The pattern to search for

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides javax.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
getHeaderNameback to summary
public String getHeaderName()

Return the name of the header to compare with.

Returns:String

the name of the header

hashCodeback to summary
public int hashCode()

Overrides javax.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 javax.mail.search.SearchTerm.match.

The header match method.

Parameters
msg:Message

The match is applied to this Message's header

Returns:boolean

true if the match succeeds, otherwise false

Annotations
@Override