Example usage for com.google.gson GsonBuilder registerTypeAdapter

List of usage examples for com.google.gson GsonBuilder registerTypeAdapter

Introduction

In this page you can find the example usage for com.google.gson GsonBuilder registerTypeAdapter.

Prototype

@SuppressWarnings({ "unchecked", "rawtypes" })
public GsonBuilder registerTypeAdapter(Type type, Object typeAdapter) 

Source Link

Document

Configures Gson for custom serialization or deserialization.

Usage

From source file:com.ccc.crest.core.cache.crest.tournament.TournamentSeriesCollection.java

License:Open Source License

public static Future<EveData> getFuture(long tournamentId, CrestResponseCallback callback) throws Exception {
    String url = getUrl();/*from  w  ww. j av a 2  s.c  om*/
    url += tournamentId + "/series/";
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(TournamentSeriesCollection.class, new TournamentSeriesCollection());
    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, url, gson.create(), null,
            TournamentSeriesCollection.class, callback, ReadScope, getVersion(VersionType.Get), continueRefresh,
            false);
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.tournament.TournamentStatic.java

License:Open Source License

public static Future<EveData> getFuture(long id, CrestResponseCallback callback) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(TournamentStatic.class, new TournamentStatic());

    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(), gson.create(), null, TournamentStatic.class,
            callback, ReadScope, getVersion(VersionType.Get), continueRefresh, false);
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.tournament.TournamentTeam.java

License:Open Source License

public static Future<EveData> getFuture(CrestResponseCallback callback) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(TournamentTeam.class, new TournamentTeam());

    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(), gson.create(), null, TournamentTeam.class,
            callback, ReadScope, getVersion(VersionType.Get), continueRefresh, false);
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.tournament.TournamentTeam2.java

License:Open Source License

public static Future<EveData> getFuture(CrestResponseCallback callback) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(TournamentTeam2.class, new TournamentTeam2());

    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(), gson.create(), null, TournamentTeam2.class,
            callback, ReadScope, getVersion(VersionType.Get), continueRefresh, false);
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.tournament.TournamentTeamCollection.java

License:Open Source License

public static Future<EveData> getFuture(CrestResponseCallback callback) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(TournamentTeamCollection.class, new TournamentTeamCollection());

    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(), gson.create(), null,
            TournamentTeamCollection.class, callback, ReadScope, getVersion(VersionType.Get), continueRefresh,
            false);//from   w w w .  ja va  2 s  . c  o m
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.tournament.TournamentTeamMemberCollection.java

License:Open Source License

public static Future<EveData> getFuture(CrestResponseCallback callback) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(TournamentTeamMemberCollection.class, new TournamentTeamMemberCollection());

    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(), gson.create(), null,
            TournamentTeamMemberCollection.class, callback, ReadScope, getVersion(VersionType.Get),
            continueRefresh, false);//from   ww  w. j a  v  a2s. c  om
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.tournament.TournamentTournament.java

License:Open Source License

public static Future<EveData> getFuture(long id, CrestResponseCallback callback) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(TournamentTournament.class, new TournamentTournament());

    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(), gson.create(), null,
            TournamentTournament.class, callback, ReadScope, getVersion(VersionType.Get), continueRefresh,
            false);//from   w  ww . ja  va 2s  . c  o  m
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.virtualGoodStore.VirtualGoodStore.java

License:Open Source License

public static Future<EveData> getFuture(CrestResponseCallback callback) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(VirtualGoodStore.class, new VirtualGoodStore());
    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(), gson.create(), null, VirtualGoodStore.class,
            callback, ReadScope, getVersion(), continueRefresh);
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.war.WarsCollection.java

License:Open Source License

public static Future<EveData> getFuture(CrestResponseCallback callback) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(WarsCollection.class, new WarsCollection());
    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(), gson.create(), null, WarsCollection.class,
            callback, ReadScope, getVersion(VersionType.Get), continueRefresh);
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.war.WarsElement.java

License:Open Source License

public static Future<EveData> getFuture(CrestResponseCallback callback) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(WarsElement.class, new WarsElement());
    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(), gson.create(), null, WarsElement.class,
            callback, ReadScope, getVersion(VersionType.Get), continueRefresh);
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}