Example usage for com.google.gson TypeAdapterFactory interface-usage

List of usage examples for com.google.gson TypeAdapterFactory interface-usage

Introduction

In this page you can find the example usage for com.google.gson TypeAdapterFactory interface-usage.

Usage

From source file com.github.piasy.common.model.AutoGenTypeAdapterFactory.java

/**
 * https://gist.github.com/Piasy/fa507251da452d36b221
 */
public final class AutoGenTypeAdapterFactory implements TypeAdapterFactory {

    @SuppressWarnings("unchecked")

From source file com.github.sheigutn.pushbullet.gson.RuntimeTypeAdapterFactory.java

/**
 * Adapts values whose runtime type may differ from their declaration type. This
 * is necessary when a field's type is not the same type that GSON should create
 * when deserializing that field. For example, consider these types:
 * <pre>   {@code
 *   abstract class Shape {

From source file com.github.terma.logb.server.RuntimeTypeAdapterFactory.java

class RuntimeTypeAdapterFactory<T> implements TypeAdapterFactory {

    private final Class<?> baseType;
    private final String typeFieldName;
    private final Map<String, Class<?>> labelToSubtype = new LinkedHashMap<String, Class<?>>();
    private final Map<Class<?>, String> subtypeToLabel = new LinkedHashMap<Class<?>, String>();

From source file com.google.caliper.json.ImmutableListTypeAdatperFactory.java

/**
 * Serializes and deserializes {@link ImmutableList} instances using an {@link ArrayList} as an
 * intermediary.
 */
final class ImmutableListTypeAdatperFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")

From source file com.google.caliper.json.ImmutableMapTypeAdapterFactory.java

/**
 * Serializes and deserializes {@link ImmutableMap} instances using a {@link HashMap} as an
 * intermediary.
 */
final class ImmutableMapTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")

From source file com.google.caliper.json.ImmutableMultimapTypeAdapterFactory.java

/**
 * Serializes and deserializes {@link ImmutableMultimap} instances using maps of collections as
 * intermediaries.
 */
final class ImmutableMultimapTypeAdapterFactory implements TypeAdapterFactory {
    private static <K, V> TypeToken<Map<K, List<V>>> getMapOfListsToken(TypeToken<ListMultimap<K, V>> from) {

From source file com.google.caliper.json.NaturallySortedMapTypeAdapterFactory.java

/**
 * Serializes and deserializes {@link SortedMap} instances using a {@link TreeMap} with natural
 * ordering as an intermediary.
 */
final class NaturallySortedMapTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("rawtypes")

From source file com.google.devtools.moe.client.config.ConfigTypeAdapterFactory.java

@GsonTypeAdapterFactory
public abstract class ConfigTypeAdapterFactory implements TypeAdapterFactory {
    public static TypeAdapterFactory create() {
        return new AutoValueGson_ConfigTypeAdapterFactory();
    }
}

From source file com.google.devtools.moe.client.gson.AutoValueGsonAdapter.java

/**
 * A Gson {@link TypeAdapterFactory} to support {@code @AutoValue}
 */
public final class AutoValueGsonAdapter implements TypeAdapterFactory {
    private static final String AUTOVALUE_PREFIX = ".AutoValue_";

From source file com.google.devtools.moe.client.gson.MoeTypeAdapterFactory.java

@GsonTypeAdapterFactory
public abstract class MoeTypeAdapterFactory implements TypeAdapterFactory {
    public static TypeAdapterFactory create() {
        return new AutoValueGson_MoeTypeAdapterFactory();
    }
}