com.openexchange.mail.search
Class Searcher

java.lang.Object
  extended by com.openexchange.mail.search.Searcher

public final class Searcher
extends java.lang.Object

Searcher - Provides methods to check if a single mail message matches a search term.

Moreover it provides a method to search for matching mail messages in a given message array with a given search term.

Author:
Thorben Betten

Method Summary
static java.util.List<MailMessage> matches(java.util.List<MailMessage> mailMessages, SearchTerm<?> searchTerm)
          Applies specified search term against given instances of MailMessage
static MailMessage[] matches(MailMessage[] mailMessages, SearchTerm<?> searchTerm)
          Applies specified search term against given instances of MailMessage
static boolean matches(MailMessage mailMessage, SearchTerm<?> searchTerm)
          Deprecated. Invoke SearchTerm.matches(MailMessage) instead
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

matches

@Deprecated
public static boolean matches(MailMessage mailMessage,
                                         SearchTerm<?> searchTerm)
                       throws MailException
Deprecated. Invoke SearchTerm.matches(MailMessage) instead

Checks if specified mail message matches given search term

Parameters:
mailMessage - The mail message to check
searchTerm - The search term to apply
Returns:
true if specified mail message matches given search term; otherwise false
Throws:
MailException - If checking mail message against search term fails

matches

public static MailMessage[] matches(MailMessage[] mailMessages,
                                    SearchTerm<?> searchTerm)
                             throws MailException
Applies specified search term against given instances of MailMessage

Parameters:
mailMessages - The mail messages to check
searchTerm - The search term to apply
Returns:
The matching mail messages in order of appearance
Throws:
MailException - If checking mail messages against search term fails

matches

public static java.util.List<MailMessage> matches(java.util.List<MailMessage> mailMessages,
                                                  SearchTerm<?> searchTerm)
                                           throws MailException
Applies specified search term against given instances of MailMessage

Parameters:
mailMessages - The mail messages to check
searchTerm - The search term to apply
Returns:
The matching mail messages in order of appearance
Throws:
MailException - If checking mail messages against search term fails