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

com.starkinfra.utils.GsonEvent Maven / Gradle / Ivy

Go to download

Welcome to the Stark Infra Java SDK! This tool is made for Java developers who want to easily integrate with our API. This SDK version is compatible with the Stark Infra API v2.

There is a newer version: 0.11.2
Show newest version
package com.starkinfra.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import com.starkinfra.Event;
import com.starkinfra.CreditNote;
import com.starkinfra.CreditPreview;


class GsonEvent {
    private static Gson instance;

    private GsonEvent() {}

    public static synchronized Gson getInstance()
    {
        if(instance == null)
            instance = new GsonBuilder()
                    .registerTypeAdapter(Event.class, new Event.Deserializer())
                    .registerTypeAdapter(CreditNote.class, new CreditNote.Deserializer())
                    .registerTypeAdapter(CreditPreview.class, new CreditPreview.Deserializer())
                    .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSZ")
                    .create();
        return instance;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy