com.ingenico.connect.gateway.sdk.java.Marshaller Maven / Gradle / Ivy
package com.ingenico.connect.gateway.sdk.java;
import java.io.InputStream;
/**
* Used to marshal and unmarshal Ingenico ePayments platform request and response objects to and from JSON. Thread-safe.
*/
public interface Marshaller {
/**
* Marshal a request object to a JSON string.
*/
String marshal(Object requestObject);
/**
* Unmarshal a JSON string to a response object.
*
* @param type The response object type.
* @throws MarshallerSyntaxException if the JSON is not a valid representation for an object of the given type
*/
T unmarshal(String responseJson, Class type);
/**
* Unmarshal a JSON stream to a response object.
*
* @param type The response object type.
* @throws MarshallerSyntaxException if the JSON is not a valid representation for an object of the given type
*/
T unmarshal(InputStream responseJson, Class type);
}