Class MutableMessage<T>
java.lang.Object
org.springframework.integration.support.MutableMessage<T>
- Type Parameters:
- T- the payload type.
- All Implemented Interfaces:
- Serializable,- Message<T>
An implementation of 
Message with a generic payload. Unlike
 GenericMessage,
 this message (or its headers) can be modified after creation.
 Great care must be taken, when mutating messages, that some other element/thread is not
 concurrently using the message. Also note that any in-memory stores (such as
 SimpleMessageStore)
 may have a reference to the message and changes will be
 reflected there too.
 IMPORTANT: Mutable messages may share state (such as message headers); such messages should never be exposed to other components or undesirable side-effects may result.
It is generally recommended that messages transferred between components should always be immutable unless great care is taken with their use.
- Since:
- 4.0
- Author:
- Gary Russell, Artem Bilan, Stuart Williams, David Turanski
- See Also:
- 
Constructor SummaryConstructorsModifierConstructorDescriptionMutableMessage(T payload) MutableMessage(T payload, Map<String, Object> headers) protectedMutableMessage(T payload, MutableMessageHeaders headers) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleaninthashCode()static MutableMessage<?>Build a newMutableMessagebased on the provided message if that one is not already aMutableMessage.toString()
- 
Constructor Details- 
MutableMessage
- 
MutableMessage
- 
MutableMessage
 
- 
- 
Method Details- 
getHeaders- Specified by:
- getHeadersin interface- Message<T>
 
- 
getPayload- Specified by:
- getPayloadin interface- Message<T>
 
- 
toString
- 
hashCodepublic int hashCode()
- 
equals
- 
ofBuild a newMutableMessagebased on the provided message if that one is not already aMutableMessage.- Parameters:
- message- the message to build from.
- Returns:
- new MutableMessage.
- Since:
- 6.0
 
 
-