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

JavaClientCli.JsonPrinter.mustache Maven / Gradle / Ivy

Go to download

This artefact generates other artefacts such as API client, API server out of API Model

There is a newer version: 1.1.1
Show newest version
{{>licenseInfo}}
package {{invokerPackage}}.support;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class JsonPrinter {

    public static String toJson(Object o) {
        try {
            return new ObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(o);
        } catch (JsonProcessingException e) {
            return o.toString();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy