Class MessageValues
java.lang.Object
org.springframework.cloud.stream.binder.MessageValues
A mutable type for allowing
Binder implementations to transform and enrich
message content more efficiently.- Author:
- David Turanski, Marius Bogoevici
-
Nested Class Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMessageValues(Object payload, Map<String, Object> headers) MessageValues(org.springframework.messaging.Message<?> message) Create an instance from aMessage. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) voidcopyHeadersIfAbsent(Map<String, Object> headersToCopy) entrySet()booleanisEmpty()keySet()voidvoidsetPayload(Object payload) Set the payload.intsize()org.springframework.messaging.Message<?>Convert to aMessageusing a the defaultMessageBuilder.org.springframework.messaging.Message<?>toMessage(org.springframework.integration.support.MessageBuilderFactory messageBuilderFactory) Convert to aMessageusing aMessageBuilderFactory.values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
MessageValues
public MessageValues(org.springframework.messaging.Message<?> message) Create an instance from aMessage.- Parameters:
message- the message
-
MessageValues
-
-
Method Details
-
getPayload
- Returns:
- the payload
-
setPayload
Set the payload.- Parameters:
payload- any non null object.
-
getHeaders
-
toMessage
public org.springframework.messaging.Message<?> toMessage(org.springframework.integration.support.MessageBuilderFactory messageBuilderFactory) Convert to aMessageusing aMessageBuilderFactory.- Parameters:
messageBuilderFactory- the MessageBuilderFactory- Returns:
- the Message
-
toMessage
public org.springframework.messaging.Message<?> toMessage()Convert to aMessageusing a the defaultMessageBuilder.- Returns:
- the Message
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
- Specified by:
containsValuein interfaceMap<String,Object>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
copyHeadersIfAbsent
-