Class AbstractIntegrationMessageBuilder<T>
java.lang.Object
org.springframework.integration.support.AbstractIntegrationMessageBuilder<T>
- Type Parameters:
- T- the payload type.
- Direct Known Subclasses:
- MessageBuilder,- MutableMessageBuilder
- Since:
- 4.0
- Author:
- Gary Russell, Artem Bilan
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()Make a copy ofMessageHistoryheader (if present) for a new message to build.abstract AbstractIntegrationMessageBuilder<T> copyHeaders(Map<String, ?> headersToCopy) Copy the name-value pairs from the provided Map.abstract AbstractIntegrationMessageBuilder<T> copyHeadersIfAbsent(Map<String, ?> headersToCopy) Copy the name-value pairs from the provided Map.filterAndCopyHeadersIfAbsent(Map<String, ?> headersToCopy, String... headerPatternsToFilter) Remove headers from the provided map matching to the provided pattens and only after that copy the result into the target message headers.protected abstract Objectabstract <V> Vabstract Tprotected abstract Objectprotected abstract ObjectpushSequenceDetails(Object correlationId, int sequenceNumber, int sequenceSize) abstract AbstractIntegrationMessageBuilder<T> removeHeader(String headerName) Remove the value for the given header name.abstract AbstractIntegrationMessageBuilder<T> removeHeaders(String... headerPatterns) Removes all headers provided via array of 'headerPatterns'.setCorrelationId(Object correlationId) setErrorChannel(MessageChannel errorChannel) setErrorChannelName(String errorChannelName) setExpirationDate(Long expirationDate) setExpirationDate(Date expirationDate) abstract AbstractIntegrationMessageBuilder<T> Set the value for the given header name.abstract AbstractIntegrationMessageBuilder<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.setPriority(Integer priority) setReplyChannel(MessageChannel replyChannel) setReplyChannelName(String replyChannelName) setSequenceNumber(Integer sequenceNumber) setSequenceSize(Integer sequenceSize) 
- 
Constructor Details- 
AbstractIntegrationMessageBuilderpublic AbstractIntegrationMessageBuilder()
 
- 
- 
Method Details- 
setExpirationDate
- 
setExpirationDate
- 
setCorrelationId
- 
pushSequenceDetailspublic AbstractIntegrationMessageBuilder<T> pushSequenceDetails(Object correlationId, int sequenceNumber, int sequenceSize) 
- 
popSequenceDetails
- 
setReplyChannel
- 
setReplyChannelName
- 
setErrorChannel
- 
setErrorChannelName
- 
setSequenceNumber
- 
setSequenceSize
- 
setPriority
- 
filterAndCopyHeadersIfAbsentpublic AbstractIntegrationMessageBuilder<T> filterAndCopyHeadersIfAbsent(Map<String, ?> headersToCopy, @Nullable String... headerPatternsToFilter) Remove headers from the provided map matching to the provided pattens and only after that copy the result into the target message headers.- Parameters:
- headersToCopy- a map of headers to copy.
- headerPatternsToFilter- an arrays of header patterns to filter before copying.
- Returns:
- the current AbstractIntegrationMessageBuilder.
- Since:
- 5.1
- See Also:
 
- 
cloneMessageHistoryIfAnyMake a copy ofMessageHistoryheader (if present) for a new message to build.- Returns:
- the current AbstractIntegrationMessageBuilder.
- Since:
- 6.3
 
- 
getSequenceDetails
- 
getCorrelationId
- 
getSequenceNumber
- 
getSequenceSize
- 
getPayload
- 
getHeaders
- 
getHeader
- 
setHeaderpublic abstract AbstractIntegrationMessageBuilder<T> setHeader(String headerName, @Nullable Object headerValue) Set the value for the given header name. If the provided value isnull, the header will be removed.- Parameters:
- headerName- The header name.
- headerValue- The header value.
- Returns:
- this.
 
- 
setHeaderIfAbsentpublic abstract AbstractIntegrationMessageBuilder<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.- Parameters:
- headerName- The header name.
- headerValue- The header value.
- Returns:
- this.
 
- 
removeHeadersRemoves all headers provided via array of 'headerPatterns'. As the name suggests the array may contain simple matching patterns for header names. Supported pattern styles are: "xxx*", "*xxx", "*xxx*" and "xxx*yyy".- Parameters:
- headerPatterns- The header patterns.
- Returns:
- this.
 
- 
removeHeaderRemove the value for the given header name.- Parameters:
- headerName- The header name.
- Returns:
- this.
 
- 
copyHeaderspublic abstract AbstractIntegrationMessageBuilder<T> copyHeaders(@Nullable Map<String, ?> headersToCopy) Copy the name-value pairs from the provided Map. This operation will overwrite any existing values. Use {copyHeadersIfAbsent(Map)to avoid overwriting values. Note that the 'id' and 'timestamp' header values will never be overwritten.- Parameters:
- headersToCopy- The headers to copy.
- Returns:
- this.
- See Also:
 
- 
copyHeadersIfAbsentpublic abstract AbstractIntegrationMessageBuilder<T> copyHeadersIfAbsent(@Nullable Map<String, ?> headersToCopy) Copy the name-value pairs from the provided Map. This operation will not overwrite any existing values.- Parameters:
- headersToCopy- The headers to copy.
- Returns:
- this.
 
- 
build
 
-