Enum Class StoreAction

java.lang.Object
java.lang.Enum<StoreAction>
org.bluezoo.gumdrop.mailbox.StoreAction
All Implemented Interfaces:
Serializable, Comparable<StoreAction>, Constable

public enum StoreAction extends Enum<StoreAction>
Enumeration of IMAP STORE command actions.

The STORE command modifies the flags of messages. This enum defines the three operations that can be performed on message flags as specified in RFC 9051 Section 6.4.6.

Author:
Chris Burdess
See Also:
  • Enum Constant Details

    • REPLACE

      public static final StoreAction REPLACE
      Replace the existing flags with the specified flags. IMAP command: FLAGS or FLAGS.SILENT
    • ADD

      public static final StoreAction ADD
      Add the specified flags to the existing flags. IMAP command: +FLAGS or +FLAGS.SILENT
    • REMOVE

      public static final StoreAction REMOVE
      Remove the specified flags from the existing flags. IMAP command: -FLAGS or -FLAGS.SILENT
  • Method Details

    • values

      public static StoreAction[] 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

      public static StoreAction valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getImapKeyword

      public String getImapKeyword()
      Returns the IMAP keyword representation of this action. For example, ADD returns "+FLAGS".
      Returns:
      the IMAP keyword (without .SILENT suffix)
    • fromImapKeyword

      public static StoreAction fromImapKeyword(String keyword)
      Parses an IMAP store action keyword to the corresponding StoreAction enum value. The comparison is case-insensitive. The .SILENT suffix is ignored if present.
      Parameters:
      keyword - the IMAP keyword (e.g., "FLAGS", "+FLAGS", "-FLAGS.SILENT")
      Returns:
      the corresponding StoreAction, or null if not recognized
    • toString

      public String toString()
      Overrides:
      toString in class Enum<StoreAction>