javax.mail
Class Flags

The Flags class represents the set of flags on a Message. Flags
are composed of predefined system flags, and user defined flags.

A System flag is represented by the Flags.Flag
inner class. A User defined flag is represented as a String.
User flags are case-independent.

A set of standard system flags are predefined. Most folder
implementations are expected to support these flags. Some
implementations may also support arbitrary user-defined flags. The
getPermanentFlags method on a Folder returns a Flags
object that holds all the flags that are supported by that folder
implementation.

A Flags object is serializable so that (for example) the
use of Flags objects in search terms can be serialized
along with the search terms.

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.

The below code sample illustrates how to set, examine and get the
flags for a message.