Search in sources :

Example 1 with DateTimeSerializer

use of com.meniga.sdk.webservices.serializers.DateTimeSerializer in project mobile-sdk-android by meniga.

the class GsonProvider method getGsonBuilder.

public static Gson getGsonBuilder() {
    if (gson == null) {
        GsonBuilder gsonBuilder = new GsonBuilder();
        gsonBuilder.setFieldNamingStrategy(FieldNamingPolicy.IDENTITY);
        // Register custom de/serializers.
        gsonBuilder.registerTypeAdapter(DateTime.class, new DateTimeSerializer());
        gsonBuilder.registerTypeAdapter(LocalDate.class, new LocalDateSerializer());
        gsonBuilder.registerTypeAdapter(MenigaDecimal.class, new MenigaDecimalSerializer());
        gsonBuilder.registerTypeAdapter(BudgetDate.class, new BudgetDateSerializer());
        gsonBuilder.registerTypeAdapter(MenigaCategoryScore.class, new MenigaCategoryScoreSerializer());
        gson = gsonBuilder.create();
    }
    return gson;
}
Also used : GsonBuilder(com.google.gson.GsonBuilder) MenigaCategoryScoreSerializer(com.meniga.sdk.webservices.serializers.MenigaCategoryScoreSerializer) DateTimeSerializer(com.meniga.sdk.webservices.serializers.DateTimeSerializer) LocalDateSerializer(com.meniga.sdk.webservices.serializers.LocalDateSerializer) MenigaDecimalSerializer(com.meniga.sdk.webservices.serializers.MenigaDecimalSerializer) BudgetDateSerializer(com.meniga.sdk.webservices.serializers.BudgetDateSerializer)

Aggregations

GsonBuilder (com.google.gson.GsonBuilder)1 BudgetDateSerializer (com.meniga.sdk.webservices.serializers.BudgetDateSerializer)1 DateTimeSerializer (com.meniga.sdk.webservices.serializers.DateTimeSerializer)1 LocalDateSerializer (com.meniga.sdk.webservices.serializers.LocalDateSerializer)1 MenigaCategoryScoreSerializer (com.meniga.sdk.webservices.serializers.MenigaCategoryScoreSerializer)1 MenigaDecimalSerializer (com.meniga.sdk.webservices.serializers.MenigaDecimalSerializer)1