public class HashMapMessage extends HashMap<String,Object> implements Message.Mutable, Serializable
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Message.Mutable
ADVICE_FIELD, CHANNEL_FIELD, CLIENT_ID_FIELD, CONNECTION_TYPE_FIELD, DATA_FIELD, ERROR_FIELD, EXT_FIELD, ID_FIELD, INTERVAL_FIELD, MAX_INTERVAL_FIELD, MIN_VERSION_FIELD, RECONNECT_FIELD, RECONNECT_HANDSHAKE_VALUE, RECONNECT_NONE_VALUE, RECONNECT_RETRY_VALUE, SUBSCRIPTION_FIELD, SUCCESSFUL_FIELD, SUPPORTED_CONNECTION_TYPES_FIELD, TIMEOUT_FIELD, TIMESTAMP_FIELD, TRANSPORT_FIELD, VERSION_FIELD
Constructor and Description |
---|
HashMapMessage() |
HashMapMessage(Message message) |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
getAdvice()
Convenience method to retrieve the
Message.ADVICE_FIELD |
Map<String,Object> |
getAdvice(boolean create)
Convenience method to retrieve the
Message.ADVICE_FIELD and create it if it does not exist |
String |
getChannel()
Convenience method to retrieve the
Message.CHANNEL_FIELD . |
ChannelId |
getChannelId()
Convenience method to retrieve the
Message.CHANNEL_FIELD . |
String |
getClientId()
Convenience method to retrieve the
Message.CLIENT_ID_FIELD |
Object |
getData()
Convenience method to retrieve the
Message.DATA_FIELD |
Map<String,Object> |
getDataAsMap() |
Map<String,Object> |
getDataAsMap(boolean create)
Convenience method to retrieve the
Message.DATA_FIELD and create it if it does not exist |
Map<String,Object> |
getExt()
Convenience method to retrieve the
Message.EXT_FIELD |
Map<String,Object> |
getExt(boolean create)
Convenience method to retrieve the
Message.EXT_FIELD and create it if it does not exist |
String |
getId()
Convenience method to retrieve the
Message.ID_FIELD |
boolean |
isMeta()
A messages that has a meta channel is dubbed a "meta message".
|
boolean |
isPublishReply()
Publish message replies contain the "successful" field
|
boolean |
isSuccessful()
Convenience method to retrieve the
Message.SUCCESSFUL_FIELD |
void |
setChannel(String channel) |
void |
setClientId(String clientId) |
void |
setData(Object data) |
void |
setId(String id) |
void |
setSuccessful(boolean successful) |
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public HashMapMessage()
public HashMapMessage(Message message)
public Map<String,Object> getAdvice()
Message
Message.ADVICE_FIELD
public String getChannel()
Message
Message.CHANNEL_FIELD
.
Bayeux message always have a non null channel.getChannel
in interface Message
public ChannelId getChannelId()
Message
Message.CHANNEL_FIELD
.
Bayeux message always have a non null channel.getChannelId
in interface Message
public String getClientId()
Message
Message.CLIENT_ID_FIELD
getClientId
in interface Message
public Object getData()
Message
Message.DATA_FIELD
getData
in interface Message
Message.getDataAsMap()
public Map<String,Object> getDataAsMap()
getDataAsMap
in interface Message
Message.getData()
public Map<String,Object> getExt()
Message
Message.EXT_FIELD
public String getId()
Message
Message.ID_FIELD
public Map<String,Object> getAdvice(boolean create)
Message.Mutable
Message.ADVICE_FIELD
and create it if it does not existgetAdvice
in interface Message.Mutable
create
- whether to create the advice field if it does not existpublic Map<String,Object> getDataAsMap(boolean create)
Message.Mutable
Message.DATA_FIELD
and create it if it does not existgetDataAsMap
in interface Message.Mutable
create
- whether to create the data field if it does not existpublic Map<String,Object> getExt(boolean create)
Message.Mutable
Message.EXT_FIELD
and create it if it does not existgetExt
in interface Message.Mutable
create
- whether to create the ext field if it does not existpublic boolean isMeta()
Message
public boolean isPublishReply()
Message
isPublishReply
in interface Message
public boolean isSuccessful()
Message
Message.SUCCESSFUL_FIELD
isSuccessful
in interface Message
public void setChannel(String channel)
setChannel
in interface Message.Mutable
channel
- the channel of this messagepublic void setClientId(String clientId)
setClientId
in interface Message.Mutable
clientId
- the client id of this messagepublic void setData(Object data)
setData
in interface Message.Mutable
data
- the data of this messagepublic void setId(String id)
setId
in interface Message.Mutable
id
- the id of this messagepublic void setSuccessful(boolean successful)
setSuccessful
in interface Message.Mutable
successful
- the successfulness of this messageCopyright © 2008–2024 The CometD Project. All rights reserved.