Class EmailQuery.Builder
java.lang.Object
cloud.opencode.base.email.query.EmailQuery.Builder
- Enclosing class:
EmailQuery
Email Query Builder
邮件查询构建器
- Since:
- JDK 25, opencode-base-email V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbodyContains(String body) Filter by body containing text 按正文包含文本过滤build()Build the query 构建查询dateRange(LocalDateTime fromDate, LocalDateTime toDate) Set date range for emails 设置邮件日期范围Filter to only flagged/starred emails 仅过滤标记/星标邮件flaggedOnly(boolean flaggedOnly) Set flagged filter 设置标记过滤folder(EmailFolder folder) Set the folder to query 设置要查询的文件夹Set the folder to query by name 根据名称设置要查询的文件夹Filter by sender address 按发件人地址过滤Filter by multiple sender addresses 按多个发件人地址过滤fromDate(LocalDateTime fromDate) Set minimum date for emails 设置邮件最小日期Filter to only emails with attachments 仅过滤有附件的邮件hasAttachments(boolean hasAttachments) Set attachment filter 设置附件过滤Include deleted emails 包含已删除邮件includeDeleted(boolean includeDeleted) Set include deleted filter 设置包含已删除过滤limit(int limit) Set maximum number of emails to return 设置返回的最大邮件数Sort by newest first 按最新优先排序offset(int offset) Set offset for pagination 设置分页偏移量Sort by oldest first 按最旧优先排序page(int limit, int offset) Set pagination 设置分页sortBy(EmailQuery.SortOrder sortOrder) Set sort order 设置排序顺序subjectContains(String subject) Filter by subject containing text 按主题包含文本过滤Filter by recipient address 按收件人地址过滤Filter by multiple recipient addresses 按多个收件人地址过滤toDate(LocalDateTime toDate) Set maximum date for emails 设置邮件最大日期Filter to only unread emails 仅过滤未读邮件unreadOnly(boolean unreadOnly) Set unread filter 设置未读过滤
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
folder
Set the folder to query 设置要查询的文件夹- Parameters:
folder- the folder | 文件夹- Returns:
- this builder | 构建器
-
folder
Set the folder to query by name 根据名称设置要查询的文件夹- Parameters:
folder- the folder name | 文件夹名称- Returns:
- this builder | 构建器
-
fromDate
Set minimum date for emails 设置邮件最小日期- Parameters:
fromDate- the minimum date | 最小日期- Returns:
- this builder | 构建器
-
toDate
Set maximum date for emails 设置邮件最大日期- Parameters:
toDate- the maximum date | 最大日期- Returns:
- this builder | 构建器
-
dateRange
Set date range for emails 设置邮件日期范围- Parameters:
fromDate- the minimum date | 最小日期toDate- the maximum date | 最大日期- Returns:
- this builder | 构建器
-
from
Filter by sender address 按发件人地址过滤- Parameters:
from- the sender address | 发件人地址- Returns:
- this builder | 构建器
-
from
Filter by multiple sender addresses 按多个发件人地址过滤- Parameters:
from- the sender addresses | 发件人地址列表- Returns:
- this builder | 构建器
-
to
Filter by recipient address 按收件人地址过滤- Parameters:
to- the recipient address | 收件人地址- Returns:
- this builder | 构建器
-
to
Filter by multiple recipient addresses 按多个收件人地址过滤- Parameters:
to- the recipient addresses | 收件人地址列表- Returns:
- this builder | 构建器
-
subjectContains
Filter by subject containing text 按主题包含文本过滤- Parameters:
subject- the text to search in subject | 要在主题中搜索的文本- Returns:
- this builder | 构建器
-
bodyContains
Filter by body containing text 按正文包含文本过滤- Parameters:
body- the text to search in body | 要在正文中搜索的文本- Returns:
- this builder | 构建器
-
unreadOnly
Filter to only unread emails 仅过滤未读邮件- Returns:
- this builder | 构建器
-
unreadOnly
Set unread filter 设置未读过滤- Parameters:
unreadOnly- true for unread only | true仅未读- Returns:
- this builder | 构建器
-
flaggedOnly
Filter to only flagged/starred emails 仅过滤标记/星标邮件- Returns:
- this builder | 构建器
-
flaggedOnly
Set flagged filter 设置标记过滤- Parameters:
flaggedOnly- true for flagged only | true仅标记- Returns:
- this builder | 构建器
-
hasAttachments
Filter to only emails with attachments 仅过滤有附件的邮件- Returns:
- this builder | 构建器
-
hasAttachments
Set attachment filter 设置附件过滤- Parameters:
hasAttachments- true for emails with attachments | true有附件- Returns:
- this builder | 构建器
-
includeDeleted
Include deleted emails 包含已删除邮件- Returns:
- this builder | 构建器
-
includeDeleted
Set include deleted filter 设置包含已删除过滤- Parameters:
includeDeleted- true to include deleted | true包含已删除- Returns:
- this builder | 构建器
-
limit
Set maximum number of emails to return 设置返回的最大邮件数- Parameters:
limit- the maximum count | 最大数量- Returns:
- this builder | 构建器
-
offset
Set offset for pagination 设置分页偏移量- Parameters:
offset- the offset | 偏移量- Returns:
- this builder | 构建器
-
page
Set pagination 设置分页- Parameters:
limit- the maximum count | 最大数量offset- the offset | 偏移量- Returns:
- this builder | 构建器
-
sortBy
Set sort order 设置排序顺序- Parameters:
sortOrder- the sort order | 排序顺序- Returns:
- this builder | 构建器
-
newestFirst
-
oldestFirst
-
build
-