Enum Class EmailFolder
- All Implemented Interfaces:
Serializable, Comparable<EmailFolder>, Constable
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 ConstantsEnum ConstantDescriptionArchive 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 TypeMethodDescriptionstatic EmailFolderFind folder enum by name (case-insensitive) 根据名称查找文件夹枚举(不区分大小写)String[]Get all possible folder names (primary + alternatives) 获取所有可能的文件夹名称(主要名称 + 可选名称)String[]Get alternative folder names 获取可选文件夹名称getName()Get the primary folder name 获取主要文件夹名称booleanCheck if this folder matches the given name 检查此文件夹是否匹配给定名称toString()static EmailFolderReturns the enum constant of this class with the specified name.static EmailFolder[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INBOX
Inbox folder (default) 收件箱文件夹(默认) -
SENT
Sent items folder 已发送邮件文件夹 -
DRAFTS
Drafts folder 草稿箱文件夹 -
TRASH
Trash/Deleted items folder 已删除/垃圾箱文件夹 -
SPAM
Spam/Junk folder 垃圾邮件文件夹 -
ARCHIVE
Archive folder 归档文件夹 -
STARRED
Starred/Flagged items folder 星标/标记邮件文件夹 -
IMPORTANT
Important items folder 重要邮件文件夹
-
-
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
-
getName
Get the primary folder name 获取主要文件夹名称- Returns:
- the primary folder name | 主要文件夹名称
-
getAlternativeNames
Get alternative folder names 获取可选文件夹名称- Returns:
- array of alternative names | 可选名称数组
-
getAllNames
Get all possible folder names (primary + alternatives) 获取所有可能的文件夹名称(主要名称 + 可选名称)- Returns:
- array of all possible names | 所有可能的名称数组
-
fromName
Find folder enum by name (case-insensitive) 根据名称查找文件夹枚举(不区分大小写)- Parameters:
name- the folder name | 文件夹名称- Returns:
- the matching folder or null | 匹配的文件夹或null
-
matches
Check if this folder matches the given name 检查此文件夹是否匹配给定名称- Parameters:
name- the folder name to check | 要检查的文件夹名称- Returns:
- true if matches | 匹配返回true
-
toString
- Overrides:
toStringin classEnum<EmailFolder>
-