Package io.camunda.zeebe.client.impl
Class ZeebeObjectMapper
java.lang.Object
io.camunda.zeebe.client.impl.ZeebeObjectMapper
- All Implemented Interfaces:
JsonMapper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> T
Deserializes a JSON string into an equivalent POJO of typeT
.fromJsonAsMap
(String json) Deserializes a JSON string into a string to object map.fromJsonAsStringMap
(String json) Deserializes a JSON string into a string to string map.Serializes an object (POJO, map, list, etc.) into an JSON string.validateJson
(String propertyName, InputStream jsonInput) Validates a stream that contains a JSON string.validateJson
(String propertyName, String jsonInput) Validates a JSON string.
-
Constructor Details
-
ZeebeObjectMapper
public ZeebeObjectMapper() -
ZeebeObjectMapper
public ZeebeObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
fromJson
Description copied from interface:JsonMapper
Deserializes a JSON string into an equivalent POJO of typeT
.- Specified by:
fromJson
in interfaceJsonMapper
- Type Parameters:
T
- the type of the returned object- Parameters:
json
- the JSON string to deserializetypeClass
- the Java type to deserialize into- Returns:
- the POJO deserialized from the given JSON string
-
fromJsonAsMap
Description copied from interface:JsonMapper
Deserializes a JSON string into a string to object map.- Specified by:
fromJsonAsMap
in interfaceJsonMapper
- Parameters:
json
- the JSON string to deserialize- Returns:
- the map deserialized from the given JSON string
-
fromJsonAsStringMap
Description copied from interface:JsonMapper
Deserializes a JSON string into a string to string map.- Specified by:
fromJsonAsStringMap
in interfaceJsonMapper
- Parameters:
json
- the JSON string to deserialize- Returns:
- the map deserialized from the given JSON string
-
toJson
Description copied from interface:JsonMapper
Serializes an object (POJO, map, list, etc.) into an JSON string.- Specified by:
toJson
in interfaceJsonMapper
- Parameters:
value
- the object to serialize- Returns:
- a JSON string serialized from the given object
-
validateJson
Description copied from interface:JsonMapper
Validates a JSON string. If it is not valid throws aInternalClientException
.- Specified by:
validateJson
in interfaceJsonMapper
- Parameters:
propertyName
- the property name that contains the JSON stringjsonInput
- the JSON string- Returns:
- the same JSON string, that passed in
-
validateJson
Description copied from interface:JsonMapper
Validates a stream that contains a JSON string. If it is not valid throws aInternalClientException
- Specified by:
validateJson
in interfaceJsonMapper
- Parameters:
propertyName
- a property name that contains the streamjsonInput
- the stream that contains the JSON string- Returns:
- the JSON string from the stream
-