Enum Class EmailFolder

java.lang.Object
java.lang.Enum<EmailFolder>
cloud.opencode.base.email.query.EmailFolder
All Implemented Interfaces:
Serializable, Comparable<EmailFolder>, Constable

public enum EmailFolder extends Enum<EmailFolder>
Email Folder Enumeration 邮件文件夹枚举

Standard email folder names used by IMAP/POP3.

IMAP/POP3使用的标准邮件文件夹名称。

Features | 主要功能:

  • Standard folder names - 标准文件夹名称
  • Common name aliases - 通用名称别名
  • Provider-specific name mapping - 供应商特定名称映射

Usage Examples | 使用示例:

// Use standard folder
EmailQuery query = EmailQuery.builder()
    .folder(EmailFolder.INBOX)
    .unreadOnly()
    .build();

// Use custom folder name
EmailQuery query = EmailQuery.builder()
    .folder("Custom/MyFolder")
    .build();

Security | 安全性:

  • Thread-safe: Yes (enum is immutable) - 线程安全: 是(枚举不可变)
Since:
JDK 25, opencode-base-email V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Archive folder 归档文件夹
    Drafts folder 草稿箱文件夹
    Important items folder 重要邮件文件夹
    Inbox folder (default) 收件箱文件夹(默认)
    Sent items folder 已发送邮件文件夹
    Spam/Junk folder 垃圾邮件文件夹
    Starred/Flagged items folder 星标/标记邮件文件夹
    Trash/Deleted items folder 已删除/垃圾箱文件夹
  • Method Summary

    Modifier and Type
    Method
    Description
    Find folder enum by name (case-insensitive) 根据名称查找文件夹枚举(不区分大小写)
    Get all possible folder names (primary + alternatives) 获取所有可能的文件夹名称(主要名称 + 可选名称)
    Get alternative folder names 获取可选文件夹名称
    Get the primary folder name 获取主要文件夹名称
    boolean
    Check if this folder matches the given name 检查此文件夹是否匹配给定名称
     
    Returns the enum constant of this class with the specified name.
    static EmailFolder[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • INBOX

      public static final EmailFolder INBOX
      Inbox folder (default) 收件箱文件夹(默认)
    • SENT

      public static final EmailFolder SENT
      Sent items folder 已发送邮件文件夹
    • DRAFTS

      public static final EmailFolder DRAFTS
      Drafts folder 草稿箱文件夹
    • TRASH

      public static final EmailFolder TRASH
      Trash/Deleted items folder 已删除/垃圾箱文件夹
    • SPAM

      public static final EmailFolder SPAM
      Spam/Junk folder 垃圾邮件文件夹
    • ARCHIVE

      public static final EmailFolder ARCHIVE
      Archive folder 归档文件夹
    • STARRED

      public static final EmailFolder STARRED
      Starred/Flagged items folder 星标/标记邮件文件夹
    • IMPORTANT

      public static final EmailFolder IMPORTANT
      Important items folder 重要邮件文件夹
  • Method Details

    • values

      public static EmailFolder[] 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 EmailFolder 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
    • getName

      public String getName()
      Get the primary folder name 获取主要文件夹名称
      Returns:
      the primary folder name | 主要文件夹名称
    • getAlternativeNames

      public String[] getAlternativeNames()
      Get alternative folder names 获取可选文件夹名称
      Returns:
      array of alternative names | 可选名称数组
    • getAllNames

      public String[] getAllNames()
      Get all possible folder names (primary + alternatives) 获取所有可能的文件夹名称(主要名称 + 可选名称)
      Returns:
      array of all possible names | 所有可能的名称数组
    • fromName

      public static EmailFolder fromName(String name)
      Find folder enum by name (case-insensitive) 根据名称查找文件夹枚举(不区分大小写)
      Parameters:
      name - the folder name | 文件夹名称
      Returns:
      the matching folder or null | 匹配的文件夹或null
    • matches

      public boolean matches(String name)
      Check if this folder matches the given name 检查此文件夹是否匹配给定名称
      Parameters:
      name - the folder name to check | 要检查的文件夹名称
      Returns:
      true if matches | 匹配返回true
    • toString

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