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.michaelfotiadis.steam.net.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 deserialising that field. For example, consider these types:
 * <pre>   {@code
 *   abstract class Shape {

From source file com.nberserk.gae.lessontable.tt.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.nile.kmooc.model.course.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.pcloud.sdk.internal.networking.serialization.UnmodifiableListTypeFactory.java

public class UnmodifiableListTypeFactory implements TypeAdapterFactory {

    @Override
    public <T> TypeAdapter<T> create(final Gson gson, final TypeToken<T> tokenType) {
        final TypeAdapter<T> delegate = gson.getDelegateAdapter(this, tokenType);

From source file com.prayer.vakit.times.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.realitypd.cardrogue.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.redhat.thermostat.gateway.service.commands.channel.coders.typeadapters.MessageTypeAdapterFactory.java

public class MessageTypeAdapterFactory implements TypeAdapterFactory {

    @SuppressWarnings("unchecked")
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
        Class<?> clazz = type.getRawType();

From source file com.saccode.ahlcgcm.arkhamhorrorcampaignmanager.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.sagiller.learn.json.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.sauzny.gradlejava.cognitivej.identify.tools.ClassTypeAdapterFactory.java

public class ClassTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
        if (!Class.class.isAssignableFrom(typeToken.getRawType())) {
            return null;