Class GenericMessage<T>
java.lang.Object
org.springframework.messaging.support.GenericMessage<T>
- Type Parameters:
 T- the payload type
- All Implemented Interfaces:
 Serializable,Message<T>
- Direct Known Subclasses:
 ErrorMessage
An implementation of 
Message with a generic payload.
 Once created, a GenericMessage is immutable.- Since:
 - 4.0
 - Author:
 - Mark Fisher
 - See Also:
 
- 
Constructor Summary
ConstructorsConstructorDescriptionGenericMessage(T payload) Create a new message with the given payload.GenericMessage(T payload, Map<String, Object> headers) Create a new message with the given payload and headers.GenericMessage(T payload, MessageHeaders headers) A constructor with theMessageHeadersinstance to use. - 
Method Summary
 
- 
Constructor Details
- 
GenericMessage
Create a new message with the given payload.- Parameters:
 payload- the message payload (nevernull)
 - 
GenericMessage
Create a new message with the given payload and headers. The content of the given header map is copied.- Parameters:
 payload- the message payload (nevernull)headers- message headers to use for initialization
 - 
GenericMessage
A constructor with theMessageHeadersinstance to use.Note: the given
MessageHeadersinstance is used directly in the new message, i.e. it is not copied.- Parameters:
 payload- the message payload (nevernull)headers- message headers
 
 - 
 - 
Method Details
- 
getPayload
Description copied from interface:MessageReturn the message payload.- Specified by:
 getPayloadin interfaceMessage<T>
 - 
getHeaders
Description copied from interface:MessageReturn message headers for the message (nevernullbut may be empty).- Specified by:
 getHeadersin interfaceMessage<T>
 - 
equals
 - 
hashCode
public int hashCode() - 
toString
 
 -