Package io.camunda.zeebe.client.impl
Class ZeebeObjectMapper
java.lang.Object
io.camunda.zeebe.client.impl.ZeebeObjectMapper
- All Implemented Interfaces:
JsonMapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TDeserializes 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:JsonMapperDeserializes a JSON string into an equivalent POJO of typeT.- Specified by:
fromJsonin 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:JsonMapperDeserializes a JSON string into a string to object map.- Specified by:
fromJsonAsMapin interfaceJsonMapper- Parameters:
json- the JSON string to deserialize- Returns:
- the map deserialized from the given JSON string
-
fromJsonAsStringMap
Description copied from interface:JsonMapperDeserializes a JSON string into a string to string map.- Specified by:
fromJsonAsStringMapin interfaceJsonMapper- Parameters:
json- the JSON string to deserialize- Returns:
- the map deserialized from the given JSON string
-
toJson
Description copied from interface:JsonMapperSerializes an object (POJO, map, list, etc.) into an JSON string.- Specified by:
toJsonin interfaceJsonMapper- Parameters:
value- the object to serialize- Returns:
- a JSON string serialized from the given object
-
validateJson
Description copied from interface:JsonMapperValidates a JSON string. If it is not valid throws aInternalClientException.- Specified by:
validateJsonin 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:JsonMapperValidates a stream that contains a JSON string. If it is not valid throws aInternalClientException- Specified by:
validateJsonin interfaceJsonMapper- Parameters:
propertyName- a property name that contains the streamjsonInput- the stream that contains the JSON string- Returns:
- the JSON string from the stream
-