Interface JsonChannelMessage
- All Superinterfaces:
JsonMessage
,Message
Provides an interface for receiving JSON Channel messages in an
JsonChannel
to allow json communication while avoiding having to deal with additional metadata contained in the packet.-
Method Summary
Modifier and TypeMethodDescriptionGrabs the string value of the user who has contributed from the Json message metadata<T> T
getJsonAsType
(Class<T> jsonType) Returns the object JSON deserialized into a class of type which is passed in as jsonTypevoid
setJsonTree
(Object jsonTree) Set the JsonObject in the Message to the given valueMethods inherited from interface com.caplin.datasource.messaging.json.JsonMessage
getJson, getJsonObject, isPatch
Methods inherited from interface com.caplin.datasource.messaging.Message
getMessageType, getSubject, isImage, setImage
-
Method Details
-
getJsonAsType
Returns the object JSON deserialized into a class of type which is passed in as jsonType- Type Parameters:
T
- the generic return type- Parameters:
jsonType
- the class which we deserialize intp- Returns:
- the deserialized json class
- Throws:
Exception
-
getContribUser
Grabs the string value of the user who has contributed from the Json message metadata- Returns:
- the contribUser value as String
- Throws:
Exception
-
setJsonTree
Set the JsonObject in the Message to the given value- Parameters:
jsonTree
- the json object to be set
-