Java Code Examples for com.fatboyindustrial.gsonjodatime.Converters

The following examples show how to use com.fatboyindustrial.gsonjodatime.Converters. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private Gson gson() {
    final GsonBuilder builder = new GsonBuilder();
    // support swagger json
    builder.registerTypeAdapter(Json.class, new SpringfoxJsonToGsonAdapter());

    return Converters.registerDateTime(builder).create();
}
 
Example 2
@Override
public boolean configureMessageConverters(List<MessageConverter> messageConverters) {
    messageConverters.add(new StringMessageConverter());
    messageConverters.add(new ByteArrayMessageConverter());

    GsonMessageConverter gsonMessageConverter = new GsonMessageConverter();
    gsonMessageConverter.setGson(Converters.registerDateTime(new GsonBuilder()).create());
    messageConverters.add(gsonMessageConverter);

    return false;
}
 
Example 3
Source Project: android-rxmvp-tutorial   Source File: GsonModule.java    License: Apache License 2.0 5 votes vote down vote up
@AppScope
@Provides
public Gson context() {
  return Converters.registerAll(new GsonBuilder())
      .registerTypeAdapterFactory(GithubAdapterFactory.create())
      .create();
}
 
Example 4
Source Project: android-rxmvp   Source File: GsonModule.java    License: Apache License 2.0 5 votes vote down vote up
@AppScope
@Provides
public Gson gson() {
    GsonBuilder builder = new GsonBuilder();
    Converters.registerAll(builder);
    return builder.create();
}