com.openexchange.mail.search
Class BooleanTerm

java.lang.Object
  extended by com.openexchange.mail.search.SearchTerm<java.lang.Boolean>
      extended by com.openexchange.mail.search.BooleanTerm
All Implemented Interfaces:
java.io.Serializable

public final class BooleanTerm
extends SearchTerm<java.lang.Boolean>

BooleanTerm

Author:
Thorben Betten
See Also:
Serialized Form

Field Summary
static BooleanTerm FALSE
          The boolean term for false
static BooleanTerm TRUE
          The boolean term for true
 
Method Summary
 void addMailField(java.util.Collection<MailField> col)
          Adds the addressed MailField to specified collection
 javax.mail.search.SearchTerm getJavaMailSearchTerm()
          Generates the corresponding JavaMail instance of SearchTerm from this search term
 javax.mail.search.SearchTerm getNonWildcardJavaMailSearchTerm()
          Generates the corresponding instance of SearchTerm from this search term without any wildcard characters.
 java.lang.Boolean getPattern()
          Gets the pattern to which the expression should match.
 boolean matches(MailMessage mailMessage)
          Checks if specified mail message matches this search term
 boolean matches(javax.mail.Message msg)
          Checks if given message matches this search term
 
Methods inherited from class com.openexchange.mail.search.SearchTerm
containsWildcard, filter, filter, isAscii
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRUE

public static final BooleanTerm TRUE
The boolean term for true


FALSE

public static final BooleanTerm FALSE
The boolean term for false

Method Detail

getPattern

public java.lang.Boolean getPattern()
Description copied from class: SearchTerm
Gets the pattern to which the expression should match.

Specified by:
getPattern in class SearchTerm<java.lang.Boolean>
Returns:
The pattern

addMailField

public void addMailField(java.util.Collection<MailField> col)
Description copied from class: SearchTerm
Adds the addressed MailField to specified collection

Specified by:
addMailField in class SearchTerm<java.lang.Boolean>
Parameters:
col - The collection which gathers addressed fields

getJavaMailSearchTerm

public javax.mail.search.SearchTerm getJavaMailSearchTerm()
Description copied from class: SearchTerm
Generates the corresponding JavaMail instance of SearchTerm from this search term

Specified by:
getJavaMailSearchTerm in class SearchTerm<java.lang.Boolean>
Returns:
The corresponding instance of SearchTerm

getNonWildcardJavaMailSearchTerm

public javax.mail.search.SearchTerm getNonWildcardJavaMailSearchTerm()
Description copied from class: SearchTerm
Generates the corresponding instance of SearchTerm from this search term without any wildcard characters.

This is useful to preselect possible positives and to manually filtering out false positives.

Specified by:
getNonWildcardJavaMailSearchTerm in class SearchTerm<java.lang.Boolean>
Returns:
The corresponding instance of SearchTerm without any wildcard characters.
See Also:
SearchTerm.containsWildcard()

matches

public boolean matches(javax.mail.Message msg)
                throws MailException
Description copied from class: SearchTerm
Checks if given message matches this search term

Specified by:
matches in class SearchTerm<java.lang.Boolean>
Parameters:
msg - The message to check
Returns:
true if message matches this search term; otherwise false
Throws:
MailException - If check fails

matches

public boolean matches(MailMessage mailMessage)
Description copied from class: SearchTerm
Checks if specified mail message matches this search term

Specified by:
matches in class SearchTerm<java.lang.Boolean>
Parameters:
mailMessage - The mail message to check
Returns:
true if specified mail message matches this search term; otherwise false