io.vrap.rmf.base.client.ResponseSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rmf-java-base Show documentation
Show all versions of rmf-java-base Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
package io.vrap.rmf.base.client;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.vrap.rmf.base.client.utils.json.JsonUtils;
/**
* Interface to deserialize a response to a specified output type
*/
public interface ResponseSerializer {
ApiHttpResponse convertResponse(final ApiHttpResponse response, final Class outputType);
ApiHttpResponse convertResponse(final ApiHttpResponse response, final JavaType outputType);
ApiHttpResponse convertResponse(final ApiHttpResponse response, final TypeReference outputType);
byte[] toJsonByteArray(final Object value) throws JsonProcessingException;
static ResponseSerializer of() {
return new ResponseSerializerImpl(JsonUtils.getConfiguredObjectMapper());
}
static ResponseSerializer of(final ObjectMapper mapper) {
return new ResponseSerializerImpl(mapper);
}
}