⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
javax.mail.search

Class HeaderTerm

java.lang.Object
|
+--javax.mail.search.SearchTerm
   |
   +--javax.mail.search.StringTerm
      |
      +--javax.mail.search.HeaderTerm


public final class HeaderTerm
extends StringTerm

This class implements comparisons for Message headers. The comparison is case-insensitive.
Author:

Field Summary

String

headerName

The name of the header.

Constructor Summary

HeaderTerm(String headerName, String pattern)

Constructor.

Method Summary

boolean

equals(Object other)

Equality comparison.

String

getHeaderName()

Return the name of the header to compare with.

int

hashCode()

Compute a hashCode for this object.

boolean

match(Message msg)

The header match method.

Field Details

headerName

protected String headerName

The name of the header.

Constructor Details

HeaderTerm

public HeaderTerm(String headerName, String pattern)

Constructor.

Parameters:
headerName - The name of the header
pattern - The pattern to search for

Method Details

equals

public boolean equals(Object other)

Equality comparison.

Parameters:
other

getHeaderName

public String getHeaderName()

Return the name of the header to compare with.


hashCode

public int hashCode()

Compute a hashCode for this object.


match

public boolean match(Message msg)

The header match method.

Parameters:
msg - The match is applied to this Message's header
Returns:
true if the match succeeds, otherwise false