
br.com.moip.utilities.GsonFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-java Show documentation
Show all versions of sdk-java Show documentation
Java SDK for Moip APIs integration
The newest version!
package br.com.moip.utilities;
import br.com.moip.api.request.APIDateRequest;
import br.com.moip.models.APIDate;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.Date;
public class GsonFactory {
/**
*
* @return
*/
public static Gson gson() {
return new GsonBuilder()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ss")
.registerTypeAdapter(Date.class, new BirthDateRequestSerializer())
.registerTypeAdapter(APIDateRequest.class, new ApiDateSerializer())
.registerTypeAdapter(APIDate.class, new ApiDateDeserializer())
.create();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy