Class ZeebeObjectMapper

java.lang.Object
io.camunda.zeebe.client.impl.ZeebeObjectMapper
All Implemented Interfaces:
JsonMapper

public final class ZeebeObjectMapper extends Object implements JsonMapper
  • Constructor Details

    • ZeebeObjectMapper

      public ZeebeObjectMapper()
    • ZeebeObjectMapper

      public ZeebeObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • fromJson

      public <T> T fromJson(String json, Class<T> typeClass)
      Description copied from interface: JsonMapper
      Deserializes a JSON string into an equivalent POJO of type T.
      Specified by:
      fromJson in interface JsonMapper
      Type Parameters:
      T - the type of the returned object
      Parameters:
      json - the JSON string to deserialize
      typeClass - the Java type to deserialize into
      Returns:
      the POJO deserialized from the given JSON string
    • fromJsonAsMap

      public Map<String,Object> fromJsonAsMap(String json)
      Description copied from interface: JsonMapper
      Deserializes a JSON string into a string to object map.
      Specified by:
      fromJsonAsMap in interface JsonMapper
      Parameters:
      json - the JSON string to deserialize
      Returns:
      the map deserialized from the given JSON string
    • fromJsonAsStringMap

      public Map<String,String> fromJsonAsStringMap(String json)
      Description copied from interface: JsonMapper
      Deserializes a JSON string into a string to string map.
      Specified by:
      fromJsonAsStringMap in interface JsonMapper
      Parameters:
      json - the JSON string to deserialize
      Returns:
      the map deserialized from the given JSON string
    • toJson

      public String toJson(Object value)
      Description copied from interface: JsonMapper
      Serializes an object (POJO, map, list, etc.) into an JSON string.
      Specified by:
      toJson in interface JsonMapper
      Parameters:
      value - the object to serialize
      Returns:
      a JSON string serialized from the given object
    • validateJson

      public String validateJson(String propertyName, String jsonInput)
      Description copied from interface: JsonMapper
      Validates a JSON string. If it is not valid throws a InternalClientException.
      Specified by:
      validateJson in interface JsonMapper
      Parameters:
      propertyName - the property name that contains the JSON string
      jsonInput - the JSON string
      Returns:
      the same JSON string, that passed in
    • validateJson

      public String validateJson(String propertyName, InputStream jsonInput)
      Description copied from interface: JsonMapper
      Validates a stream that contains a JSON string. If it is not valid throws a InternalClientException
      Specified by:
      validateJson in interface JsonMapper
      Parameters:
      propertyName - a property name that contains the stream
      jsonInput - the stream that contains the JSON string
      Returns:
      the JSON string from the stream