Class MailHeadersBuilder
java.lang.Object
org.springframework.integration.support.MapBuilder<MailHeadersBuilder,java.lang.String,java.lang.Object>
org.springframework.integration.mail.dsl.MailHeadersBuilder
public class MailHeadersBuilder extends org.springframework.integration.support.MapBuilder<MailHeadersBuilder,java.lang.String,java.lang.Object>
The Mail specific
MapBuilder
implementation.- Since:
- 5.0
-
Field Summary
-
Method Summary
Modifier and Type Method Description MailHeadersBuilder
attachmentFilename(java.lang.String attachmentFilename)
Set a filename for the attachment.MailHeadersBuilder
attachmentFilenameExpression(java.lang.String attachmentFilename)
Set an expression that will be evaluated to determine the filename for the attachment.<P> MailHeadersBuilder
attachmentFilenameFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> attachmentFilename)
Set a function that will be invoked to determine the filename for the attachment.MailHeadersBuilder
bcc(java.lang.String... bcc)
Set the bcc: addresses.MailHeadersBuilder
bccExpression(java.lang.String bcc)
Set the expression that will be evaluated to determine the bcc: addresses.<P> MailHeadersBuilder
bccFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String[]> bcc)
Set a function that will be invoked to determine the bcc: addresses based on the message.MailHeadersBuilder
cc(java.lang.String... cc)
Set the cc: addresses.MailHeadersBuilder
ccExpression(java.lang.String cc)
Set the expression that will be evaluated to determine the cc: addresses.<P> MailHeadersBuilder
ccFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String[]> cc)
Set a function that will be invoked to determine the cc: addresses based on the message.MailHeadersBuilder
contentType(java.lang.String contentType)
Set the content type.MailHeadersBuilder
contentTypeExpression(java.lang.String contentType)
Set an expression that will be evaluated to determine the content type.<P> MailHeadersBuilder
contentTypeFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> contentType)
Set a function that will be invoked to determine the content type.MailHeadersBuilder
from(java.lang.String from)
Set the From: address.MailHeadersBuilder
fromExpression(java.lang.String from)
Set the expression that will be evaluated to determine the From: address.<P> MailHeadersBuilder
fromFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> from)
Set a function that will be invoked to determine the From: address based on the message.MailHeadersBuilder
multipartMode(int multipartMode)
Set a multipart mode to use.MailHeadersBuilder
multipartModeExpression(java.lang.String multipartMode)
Set an expression that is evaluated to determine a multipart mode to use.<P> MailHeadersBuilder
multipartModeFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.Integer> multipartMode)
Set a function that is invoked to determine a multipart mode to use.MailHeadersBuilder
replyTo(java.lang.String replyTo)
Set the ReplyTo: address.MailHeadersBuilder
replyToExpression(java.lang.String replyTo)
Set the expression that will be evaluated to determine the ReplyTo: address.<P> MailHeadersBuilder
replyToFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> replyTo)
Set a function that will be invoked to determine the ReplyTo: address based on the message.MailHeadersBuilder
subject(java.lang.String subject)
Set the subject.MailHeadersBuilder
subjectExpression(java.lang.String subject)
Set the expression that will be evaluated to determine th subject.<P> MailHeadersBuilder
subjectFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> subject)
Set a function that will be invoked to return the subject based on the message.MailHeadersBuilder
to(java.lang.String... to)
Set the To: addresses.MailHeadersBuilder
toExpression(java.lang.String to)
Set the expression that will be evaluated to determine the To: addresses.<P> MailHeadersBuilder
toFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String[]> to)
Set a function that will be invoked to determine the To: addresses based on the message.
-
Method Details
-
subject
Set the subject.- Parameters:
subject
- the subject.- Returns:
- the builder.
-
subjectExpression
Set the expression that will be evaluated to determine th subject.- Parameters:
subject
- the subject expression.- Returns:
- the builder.
-
subjectFunction
public <P> MailHeadersBuilder subjectFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> subject)Set a function that will be invoked to return the subject based on the message.- Type Parameters:
P
- the message payload type.- Parameters:
subject
- the function.- Returns:
- the builder.
-
to
Set the To: addresses.- Parameters:
to
- the addresses.- Returns:
- the builder.
-
toExpression
Set the expression that will be evaluated to determine the To: addresses.- Parameters:
to
- the expression.- Returns:
- the builder.
-
toFunction
public <P> MailHeadersBuilder toFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String[]> to)Set a function that will be invoked to determine the To: addresses based on the message.- Type Parameters:
P
- the message payload type.- Parameters:
to
- the function.- Returns:
- the builder.
-
cc
Set the cc: addresses.- Parameters:
cc
- the addresses.- Returns:
- the builder.
-
ccExpression
Set the expression that will be evaluated to determine the cc: addresses.- Parameters:
cc
- the expression.- Returns:
- the builder.
-
ccFunction
public <P> MailHeadersBuilder ccFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String[]> cc)Set a function that will be invoked to determine the cc: addresses based on the message.- Type Parameters:
P
- the message payload type.- Parameters:
cc
- the function.- Returns:
- the builder.
-
bcc
Set the bcc: addresses.- Parameters:
bcc
- the addresses.- Returns:
- the builder.
-
bccExpression
Set the expression that will be evaluated to determine the bcc: addresses.- Parameters:
bcc
- the expression.- Returns:
- the builder.
-
bccFunction
public <P> MailHeadersBuilder bccFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String[]> bcc)Set a function that will be invoked to determine the bcc: addresses based on the message.- Type Parameters:
P
- the message payload type.- Parameters:
bcc
- the function.- Returns:
- the builder.
-
from
Set the From: address.- Parameters:
from
- the address.- Returns:
- the builder.
-
fromExpression
Set the expression that will be evaluated to determine the From: address.- Parameters:
from
- the expression.- Returns:
- the builder.
-
fromFunction
public <P> MailHeadersBuilder fromFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> from)Set a function that will be invoked to determine the From: address based on the message.- Type Parameters:
P
- the message payload type.- Parameters:
from
- the function.- Returns:
- the builder.
-
replyTo
Set the ReplyTo: address.- Parameters:
replyTo
- the address.- Returns:
- the builder.
-
replyToExpression
Set the expression that will be evaluated to determine the ReplyTo: address.- Parameters:
replyTo
- the expression.- Returns:
- the builder.
-
replyToFunction
public <P> MailHeadersBuilder replyToFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> replyTo)Set a function that will be invoked to determine the ReplyTo: address based on the message.- Type Parameters:
P
- the message payload type.- Parameters:
replyTo
- the function.- Returns:
- the builder.
-
multipartMode
Set a multipart mode to use. Possible values are 0 through 3.- Parameters:
multipartMode
- header value- Returns:
- this
- See Also:
MimeMessageHelper
-
multipartModeExpression
Set an expression that is evaluated to determine a multipart mode to use. Possible values are 0 through 3.- Parameters:
multipartMode
- header value.- Returns:
- the builder.
- See Also:
MimeMessageHelper
-
multipartModeFunction
public <P> MailHeadersBuilder multipartModeFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.Integer> multipartMode)Set a function that is invoked to determine a multipart mode to use. Possible values are 0 through 3.- Type Parameters:
P
- the message payload type.- Parameters:
multipartMode
- header value- Returns:
- the builder.
- See Also:
MimeMessageHelper
-
attachmentFilename
Set a filename for the attachment.- Parameters:
attachmentFilename
- the file name.- Returns:
- the builder.
-
attachmentFilenameExpression
Set an expression that will be evaluated to determine the filename for the attachment.- Parameters:
attachmentFilename
- the expression.- Returns:
- the builder.
-
attachmentFilenameFunction
public <P> MailHeadersBuilder attachmentFilenameFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> attachmentFilename)Set a function that will be invoked to determine the filename for the attachment.- Type Parameters:
P
- the message payload type.- Parameters:
attachmentFilename
- the function.- Returns:
- the builder.
-
contentType
Set the content type.- Parameters:
contentType
- the content type.- Returns:
- the builder.
-
contentTypeExpression
Set an expression that will be evaluated to determine the content type.- Parameters:
contentType
- the expression.- Returns:
- the builder.
-
contentTypeFunction
public <P> MailHeadersBuilder contentTypeFunction(java.util.function.Function<org.springframework.messaging.Message<P>,java.lang.String> contentType)Set a function that will be invoked to determine the content type.- Type Parameters:
P
- the message payload type.- Parameters:
contentType
- the expression.- Returns:
- the builder.
-