public class JsonFormatter
extends java.lang.Object
Constructor and Description |
---|
JsonFormatter() |
Modifier and Type | Method and Description |
---|---|
static VehicleMessage |
deserialize(java.lang.String data)
Deserialize a single vehicle messages from the string.
|
static java.lang.String |
serialize(java.util.Collection<VehicleMessage> messages)
Serialize a collection of messages to a string.
|
static java.lang.String |
serialize(VehicleMessage message)
Serialize a vehicle message to a string.
|
public static java.lang.String serialize(VehicleMessage message)
message
- the message to serializepublic static java.lang.String serialize(java.util.Collection<VehicleMessage> messages)
messages
- the messages to serialize.public static VehicleMessage deserialize(java.lang.String data) throws UnrecognizedMessageTypeException
data
- a String containing the JSON serialized vehicle message.UnrecognizedMessageTypeException
- if no message could be
deserialized.