All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gocardless.http.RequestWriter Maven / Gradle / Ivy

There is a newer version: 6.0.0
Show newest version
package com.gocardless.http;

import com.google.gson.Gson;
import com.google.gson.JsonObject;

final class RequestWriter {
    private final Gson gson;

    RequestWriter(Gson gson) {
        this.gson = gson;
    }

    public  String write(T object, String envelope) {
        JsonObject result = new JsonObject();
        result.add(envelope, gson.toJsonTree(object));
        return gson.toJson(result);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy