Package org.bluezoo.gumdrop.mailbox
Enum Class Flag
- All Implemented Interfaces:
Serializable,Comparable<Flag>,Constable
Enumeration of standard IMAP message flags.
These flags are defined in RFC 9051 (IMAP4rev2) Section 2.3.2. While the IMAP specification theoretically allows for custom flags, in practice only these standard flags are widely used and understood.
- Author:
- Chris Burdess
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMessage has been answered.Message is marked for deletion.Message is a draft (incomplete composition).Message is flagged for urgent/special attention.Message is "recent" - this is the first session to be notified about this message.Message has been read. -
Method Summary
Modifier and TypeMethodDescriptionallFlags()Returns the set of all flags.static FlagfromImapAtom(String atom) Parses an IMAP flag atom string to the corresponding Flag enum value.Returns the IMAP atom representation of this flag.Returns the set of all permanent flags.toString()static FlagReturns the enum constant of this class with the specified name.static Flag[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SEEN
Message has been read. IMAP atom: \Seen -
ANSWERED
Message has been answered. IMAP atom: \Answered -
FLAGGED
Message is flagged for urgent/special attention. IMAP atom: \Flagged -
DELETED
Message is marked for deletion. The message will be permanently removed when the mailbox is expunged. IMAP atom: \Deleted -
DRAFT
Message is a draft (incomplete composition). IMAP atom: \Draft -
RECENT
Message is "recent" - this is the first session to be notified about this message. This flag is read-only and cannot be altered by the client. IMAP atom: \Recent
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getImapAtom
Returns the IMAP atom representation of this flag. For example, SEEN returns "\\Seen".- Returns:
- the IMAP flag atom
-
fromImapAtom
Parses an IMAP flag atom string to the corresponding Flag enum value. The comparison is case-insensitive.- Parameters:
atom- the IMAP flag atom (e.g., "\\Seen", "\\SEEN", "\\seen")- Returns:
- the corresponding Flag, or null if not recognized
-
permanentFlags
Returns the set of all permanent flags. Permanent flags are those that can be stored persistently. This excludes RECENT which is session-specific and read-only.- Returns:
- set of permanent flags
-
allFlags
Returns the set of all flags.- Returns:
- set of all flags
-
toString
-