com.openexchange.mail.search.service
Class MailAttributeFetcher

java.lang.Object
  extended by com.openexchange.mail.search.service.MailAttributeFetcher
All Implemented Interfaces:
com.openexchange.search.SearchAttributeFetcher<MailMessage>

public final class MailAttributeFetcher
extends java.lang.Object
implements com.openexchange.search.SearchAttributeFetcher<MailMessage>

MailAttributeFetcher - The attribute fetcher for mail module.

Author:
Thorben Betten

Method Summary
<T> T
getAttribute(java.lang.String attributeName, MailMessage candidate)
          Fetches specified attribute from given candidate.
static MailAttributeFetcher getInstance()
          Gets the mail attribute fetcher instance.
 SearchTerm<?> getSearchTerm(java.lang.String attributeName, com.openexchange.search.SingleSearchTerm.SingleOperation operation, java.lang.Object constant)
          Gets the mail search term for given simple search term identifier
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MailAttributeFetcher getInstance()
Gets the mail attribute fetcher instance.

Returns:
The mail attribute fetcher instance.

getAttribute

public <T> T getAttribute(java.lang.String attributeName,
                          MailMessage candidate)
Description copied from interface: com.openexchange.search.SearchAttributeFetcher
Fetches specified attribute from given candidate.

Specified by:
getAttribute in interface com.openexchange.search.SearchAttributeFetcher<MailMessage>
Parameters:
attributeName - The attribute name
candidate - The candidate to fetch from
Returns:
The fetched attribute

getSearchTerm

public SearchTerm<?> getSearchTerm(java.lang.String attributeName,
                                   com.openexchange.search.SingleSearchTerm.SingleOperation operation,
                                   java.lang.Object constant)
Gets the mail search term for given simple search term identifier

Parameters:
attributeName - The attribute name
operation - The operation
constant - The constant to compare to
Returns:
The mail search term
Throws:
java.lang.IllegalArgumentException - If search term cannot be returned