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.alliance.AlliancesElement.java

License:Open Source License

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

From source file:com.ccc.crest.core.cache.crest.authEndpoint.AuthenticationEndpoint.java

License:Open Source License

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

From source file:com.ccc.crest.core.cache.crest.character.BloodlineCollection.java

License:Open Source License

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

From source file:com.ccc.crest.core.cache.crest.character.CharacterSearch.java

License:Open Source License

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

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

From source file:com.ccc.crest.core.cache.crest.character.RaceCollection.java

License:Open Source License

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

From source file:com.ccc.crest.core.cache.crest.character.TokenDecode.java

License:Open Source License

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

From source file:com.ccc.crest.core.cache.crest.corporation.CorporationStructureCollection.java

License:Open Source License

public static Future<EveData> getFuture(CrestClientInfo clientInfo, long corpId, int page) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(CorporationStructureCollection.class, new CorporationStructureCollection());
    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(clientInfo, getUrl(corpId, page), gson.create(), null,
            CorporationStructureCollection.class, PagingCallback, ReadScope, getVersion(VersionType.Get),
            continueRefresh, true);/*w  ww. j a va 2 s . c  om*/
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.corporation.NpcCorporationCollection.java

License:Open Source License

public static Future<EveData> getFuture(int page) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(NpcCorporationCollection.class, new NpcCorporationCollection());
    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(page), gson.create(), null,
            NpcCorporationCollection.class, PagingCallback, ReadScope, getVersion(VersionType.Get),
            continueRefresh, false);//from  w  ww.j a  va  2 s .  com
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.dogma.DogmaAttributeCollection.java

License:Open Source License

public static Future<EveData> getFuture(int page) throws Exception {
    GsonBuilder gson = new GsonBuilder();
    gson.registerTypeAdapter(DogmaAttributeCollection.class, new DogmaAttributeCollection());
    //@formatter:off
    CrestRequestData rdata = new CrestRequestData(null, getUrl(page), gson.create(), null,
            DogmaAttributeCollection.class, PagingCallback, ReadScope, getVersion(VersionType.Get),
            continueRefresh, true);//from w  w  w  .  j  av  a  2  s  .  com
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}

From source file:com.ccc.crest.core.cache.crest.dogma.DogmaEffectCollection.java

License:Open Source License

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