Class DefaultMarshaller

java.lang.Object
com.onlinepayments.json.DefaultMarshaller
All Implemented Interfaces:
Marshaller

public class DefaultMarshaller extends Object implements Marshaller
Marshaller implementation based on Gson.
  • Field Details

  • Constructor Details

    • DefaultMarshaller

      protected DefaultMarshaller()
  • Method Details

    • marshal

      public String marshal(Object requestObject)
      Description copied from interface: Marshaller
      Marshal a request object to a JSON string.
      Specified by:
      marshal in interface Marshaller
    • unmarshal

      public <T> T unmarshal(String responseJson, Class<T> type)
      Description copied from interface: Marshaller
      Unmarshal a JSON string to a response object.
      Specified by:
      unmarshal in interface Marshaller
      Parameters:
      type - The response object type.
    • unmarshal

      public <T> T unmarshal(InputStream responseJson, Class<T> type)
      Description copied from interface: Marshaller
      Unmarshal a JSON stream to a response object.
      Specified by:
      unmarshal in interface Marshaller
      Parameters:
      type - The response object type.