Example usage for com.google.gson GsonBuilder create

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

Introduction

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

Prototype

public Gson create() 

Source Link

Document

Creates a Gson instance based on the current configuration.

Usage

From source file:com.ccc.crest.core.cache.crest.alliance.Alliances.java

License:Open Source License

public String toJson() {
    GsonBuilder gson = new GsonBuilder();
    gson.setPrettyPrinting();/*www  . j  av a  2s  . c  o m*/
    return gson.create().toJson(this);
}

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);/*from   w  w  w.java2  s . c  o m*/
    //@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  w  w.  j a  v a2  s. co m
    //@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);//w w w.j a  v  a  2 s  .  c  o  m
    //@formatter:on
    return CrestController.getCrestController().crestClient.getCrest(rdata);
}