Record Class ParsedMessage
java.lang.Object
java.lang.Record
cloud.opencode.base.email.protocol.mime.ParsedMessage
- Record Components:
messageId- the Message-ID header value | Message-ID 邮件头值from- the sender email address | 发件人邮箱地址fromName- the sender display name (nullable) | 发件人显示名称to- the recipient addresses | 收件人地址列表cc- the CC addresses | 抄送地址列表bcc- the BCC addresses | 密送地址列表replyTo- the Reply-To address (nullable) | 回复地址subject- the decoded subject | 解码后的主题textContent- the plain text body (nullable) | 纯文本正文htmlContent- the HTML body (nullable) | HTML正文sentDate- the sent date (from Date header, nullable) | 发送日期receivedDate- the received date (from Received header, nullable) | 接收日期size- the total message size in bytes | 消息总字节大小headers- all parsed headers as name-value pairs | 所有解析的邮件头attachments- the parsed attachments | 解析的附件列表
public record ParsedMessage(String messageId, String from, String fromName, List<String> to, List<String> cc, List<String> bcc, String replyTo, String subject, String textContent, String htmlContent, Instant sentDate, Instant receivedDate, int size, Map<String,String> headers, List<ParsedMessage.ParsedAttachment> attachments)
extends Record
Parsed MIME Message Record
已解析的 MIME 消息记录
Immutable result of parsing a raw RFC 2822 MIME message. Contains all extracted headers, body content (plain text and/or HTML), sent/received dates, and attachments.
解析原始 RFC 2822 MIME 消息的不可变结果。包含所有提取的邮件头、消息体内容 (纯文本和/或HTML)、发送/接收日期和附件。
Features | 主要功能:
- Extracted addresses (from, to, cc, bcc) - 提取的地址
- Decoded subject (RFC 2047) - 解码的主题
- Plain text and HTML body - 纯文本和HTML正文
- Attachment data with metadata - 附件数据及元数据
- All raw headers - 所有原始邮件头
Security | 安全性:
- Thread-safe: Yes (immutable record) - 线程安全: 是(不可变记录)
- Null-safe: Fields may be null for absent values - 缺失值的字段可能为null
- Since:
- JDK 25, opencode-base-email V1.0.3
- Author:
- Leon Soo
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordParsed Attachment Record 已解析的附件记录 -
Constructor Summary
ConstructorsConstructorDescriptionParsedMessage(String messageId, String from, String fromName, List<String> to, List<String> cc, List<String> bcc, String replyTo, String subject, String textContent, String htmlContent, Instant sentDate, Instant receivedDate, int size, Map<String, String> headers, List<ParsedMessage.ParsedAttachment> attachments) Creates an instance of aParsedMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattachmentsrecord component.bcc()Returns the value of thebccrecord component.cc()Returns the value of theccrecord component.final booleanIndicates whether some other object is "equal to" this one.from()Returns the value of thefromrecord component.fromName()Returns the value of thefromNamerecord component.final inthashCode()Returns a hash code value for this object.headers()Returns the value of theheadersrecord component.Returns the value of thehtmlContentrecord component.Returns the value of themessageIdrecord component.Returns the value of thereceivedDaterecord component.replyTo()Returns the value of thereplyTorecord component.sentDate()Returns the value of thesentDaterecord component.intsize()Returns the value of thesizerecord component.subject()Returns the value of thesubjectrecord component.Returns the value of thetextContentrecord component.to()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ParsedMessage
public ParsedMessage(String messageId, String from, String fromName, List<String> to, List<String> cc, List<String> bcc, String replyTo, String subject, String textContent, String htmlContent, Instant sentDate, Instant receivedDate, int size, Map<String, String> headers, List<ParsedMessage.ParsedAttachment> attachments) Creates an instance of aParsedMessagerecord class.- Parameters:
messageId- the value for themessageIdrecord componentfrom- the value for thefromrecord componentfromName- the value for thefromNamerecord componentto- the value for thetorecord componentcc- the value for theccrecord componentbcc- the value for thebccrecord componentreplyTo- the value for thereplyTorecord componentsubject- the value for thesubjectrecord componenttextContent- the value for thetextContentrecord componenthtmlContent- the value for thehtmlContentrecord componentsentDate- the value for thesentDaterecord componentreceivedDate- the value for thereceivedDaterecord componentsize- the value for thesizerecord componentheaders- the value for theheadersrecord componentattachments- the value for theattachmentsrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
messageId
-
from
-
fromName
-
to
-
cc
-
bcc
-
replyTo
-
subject
-
textContent
Returns the value of thetextContentrecord component.- Returns:
- the value of the
textContentrecord component
-
htmlContent
Returns the value of thehtmlContentrecord component.- Returns:
- the value of the
htmlContentrecord component
-
sentDate
-
receivedDate
Returns the value of thereceivedDaterecord component.- Returns:
- the value of the
receivedDaterecord component
-
size
-
headers
-
attachments
Returns the value of theattachmentsrecord component.- Returns:
- the value of the
attachmentsrecord component
-