|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.integration.support.MessageBuilder<T>
public final class MessageBuilder<T>
Method Summary | ||
---|---|---|
Message<T> |
build()
|
|
MessageBuilder<T> |
copyHeaders(Map<String,?> headersToCopy)
Copy the name-value pairs from the provided Map. |
|
MessageBuilder<T> |
copyHeadersIfAbsent(Map<String,Object> headersToCopy)
Copy the name-value pairs from the provided Map. |
|
static
|
fromMessage(Message<T> message)
Create a builder for a new Message instance pre-populated with
all of the headers copied from the provided message. |
|
MessageBuilder<T> |
removeHeader(String headerName)
Remove the value for the given header name. |
|
MessageBuilder<T> |
setCorrelationId(Object correlationId)
|
|
MessageBuilder<T> |
setErrorChannel(MessageChannel errorChannel)
|
|
MessageBuilder<T> |
setErrorChannelName(String errorChannelName)
|
|
MessageBuilder<T> |
setExpirationDate(Date expirationDate)
|
|
MessageBuilder<T> |
setExpirationDate(Long expirationDate)
|
|
MessageBuilder<T> |
setHeader(String headerName,
Object headerValue)
Set the value for the given header name. |
|
MessageBuilder<T> |
setHeaderIfAbsent(String headerName,
Object headerValue)
Set the value for the given header name only if the header name is not already associated with a value. |
|
MessageBuilder<T> |
setPriority(Integer priority)
|
|
MessageBuilder<T> |
setReplyChannel(MessageChannel replyChannel)
|
|
MessageBuilder<T> |
setReplyChannelName(String replyChannelName)
|
|
MessageBuilder<T> |
setSequenceNumber(Integer sequenceNumber)
|
|
MessageBuilder<T> |
setSequenceSize(Integer sequenceSize)
|
|
static
|
withPayload(T payload)
Create a builder for a new Message instance with the provided payload. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T> MessageBuilder<T> fromMessage(Message<T> message)
Message
instance pre-populated with
all of the headers copied from the provided message. The payload of the
provided Message will also be used as the payload for the new message.
message
- the Message from which the payload and all headers
will be copiedpublic static <T> MessageBuilder<T> withPayload(T payload)
Message
instance with the provided payload.
payload
- the payload for the new messagepublic MessageBuilder<T> setHeader(String headerName, Object headerValue)
null
, the header will be removed.
public MessageBuilder<T> setHeaderIfAbsent(String headerName, Object headerValue)
public MessageBuilder<T> removeHeader(String headerName)
public MessageBuilder<T> copyHeaders(Map<String,?> headersToCopy)
copyHeadersIfAbsent(Map)
to avoid overwriting values. Note that the 'id' and 'timestamp' header
values will never be overwritten.
MessageHeaders.ID
,
MessageHeaders.TIMESTAMP
public MessageBuilder<T> copyHeadersIfAbsent(Map<String,Object> headersToCopy)
public MessageBuilder<T> setExpirationDate(Long expirationDate)
public MessageBuilder<T> setExpirationDate(Date expirationDate)
public MessageBuilder<T> setCorrelationId(Object correlationId)
public MessageBuilder<T> setReplyChannel(MessageChannel replyChannel)
public MessageBuilder<T> setReplyChannelName(String replyChannelName)
public MessageBuilder<T> setErrorChannel(MessageChannel errorChannel)
public MessageBuilder<T> setErrorChannelName(String errorChannelName)
public MessageBuilder<T> setSequenceNumber(Integer sequenceNumber)
public MessageBuilder<T> setSequenceSize(Integer sequenceSize)
public MessageBuilder<T> setPriority(Integer priority)
public Message<T> build()
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |