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

com.github.mizool.technology.gson.JsonObjectConverter Maven / Gradle / Ivy

package com.github.mizool.technology.gson;

import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

public class JsonObjectConverter
{
    public String toPojo(JsonObject dto)
    {
        String pojo = null;

        if (dto != null)
        {
            pojo = dto.toString();
        }

        return pojo;
    }

    public JsonObject fromPojo(String pojo)
    {
        JsonObject dto = null;

        if (pojo != null)
        {
            dto = new JsonParser().parse(pojo).getAsJsonObject();
        }

        return dto;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy