Interface Marshaller

All Known Implementing Classes:
DefaultMarshaller

public interface Marshaller
Used to marshal and unmarshal Online Payments platform request and response objects to and from JSON. Thread-safe.
  • Method Summary

    Modifier and Type
    Method
    Description
    marshal(Object requestObject)
    Marshal a request object to a JSON string.
    <T> T
    unmarshal(InputStream responseJson, Class<T> type)
    Unmarshal a JSON stream to a response object.
    <T> T
    unmarshal(String responseJson, Class<T> type)
    Unmarshal a JSON string to a response object.
  • Method Details

    • marshal

      String marshal(Object requestObject)
      Marshal a request object to a JSON string.
    • unmarshal

      <T> T unmarshal(String responseJson, Class<T> type)
      Unmarshal a JSON string to a response object.
      Parameters:
      type - The response object type.
      Throws:
      MarshallerSyntaxException - if the JSON is not a valid representation for an object of the given type
    • unmarshal

      <T> T unmarshal(InputStream responseJson, Class<T> type)
      Unmarshal a JSON stream to a response object.
      Parameters:
      type - The response object type.
      Throws:
      MarshallerSyntaxException - if the JSON is not a valid representation for an object of the given type