SearchTerm (JavaMail API documentation)
Date: 2018-05-06

javax.mail.search

## Class SearchTerm

- java.lang.Object
- - javax.mail.search.SearchTerm

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    AddressTerm, AndTerm, ComparisonTerm, FlagTerm, NotTerm, OrTerm, StringTerm

      public abstract class SearchTerm
      extends java.lang.Object
      implements java.io.Serializable

  Search criteria are expressed as a tree of search-terms, forming a parse-tree for the search expression.

  Search-terms are represented by this class. This is an abstract class; subclasses implement specific match methods.

  Search terms are serializable, which allows storing a search term between sessions. Warning: Serialized objects of this class may not be compatible with future JavaMail API releases. The current serialization support is appropriate for short term storage.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SearchTerm()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract boolean` | `match(Message msg)` This method applies a specific match criterion to the given message and returns the result.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SearchTerm

          public SearchTerm()

  - ### Method Detail

    - #### match

          public abstract boolean match(Message msg)

      This method applies a specific match criterion to the given message and returns the result.
      Parameters:
        `msg` - The match criterion is applied on this message
      Returns:
        true, it the match succeeds, false if the match fails

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms< /a>.