Example usage for com.google.gson TypeAdapter subclass-usage

List of usage examples for com.google.gson TypeAdapter subclass-usage

Introduction

In this page you can find the example usage for com.google.gson TypeAdapter subclass-usage.

Usage

From source file com.flipkart.batching.gson.adapters.batch.SizeTimeBatchTypeAdapter.java

public final class SizeTimeBatchTypeAdapter<T extends Data> extends TypeAdapter<SizeTimeBatch<T>> {
    private final TypeAdapter<DataCollection<T>> typeAdapter;

    public SizeTimeBatchTypeAdapter(TypeAdapter<T> typeAdapter) {
        this.typeAdapter = new DataCollectionTypeAdapter<T>(typeAdapter);
    }

From source file com.flipkart.batching.gson.adapters.batch.TagBatchTypeAdapter.java

public final class TagBatchTypeAdapter<T extends TagData> extends TypeAdapter<TagBatch<T>> {
    private final TypeAdapter<DataCollection<T>> typeAdapter;
    private final TypeAdapter<Tag> tagTypeAdapter;

    public TagBatchTypeAdapter(TypeAdapter<T> typeAdapter) {
        this.typeAdapter = new DataCollectionTypeAdapter<>(typeAdapter);

From source file com.flipkart.batching.gson.adapters.batch.TimeBatchTypeAdapter.java

public final class TimeBatchTypeAdapter<T extends Data> extends TypeAdapter<TimeBatch<T>> {
    private final TypeAdapter<DataCollection<T>> typeAdapter;

    public TimeBatchTypeAdapter(TypeAdapter<T> typeAdapter) {
        this.typeAdapter = new DataCollectionTypeAdapter<T>(typeAdapter);
    }

From source file com.flipkart.batching.gson.adapters.BatchImplTypeAdapter.java

public final class BatchImplTypeAdapter<T extends Data> extends TypeAdapter<BatchImpl<T>> {
    private final TypeAdapter<DataCollection<T>> typeAdapter;

    public BatchImplTypeAdapter(TypeAdapter<T> typeAdapter) {
        this.typeAdapter = new DataCollectionTypeAdapter<>(typeAdapter);
    }

From source file com.flipkart.batching.gson.adapters.data.EventDataTypeAdapter.java

public final class EventDataTypeAdapter extends TypeAdapter<EventData> {

    @Override
    public void write(JsonWriter writer, EventData object) throws IOException {
        writer.beginObject();
        if (object == null) {

From source file com.flipkart.batching.gson.adapters.data.TagDataTypeAdapter.java

public final class TagDataTypeAdapter extends TypeAdapter<TagData> {

    private TypeAdapter<Tag> tagTypeAdapter;

    public TagDataTypeAdapter() {
        this.tagTypeAdapter = new TagTypeAdapter();

From source file com.flipkart.batching.gson.adapters.data.TagTypeAdapter.java

public final class TagTypeAdapter extends TypeAdapter<Tag> {
    public TagTypeAdapter() {
    }

    @Override
    public void write(JsonWriter writer, Tag object) throws IOException {

From source file com.flipkart.batching.gson.adapters.DataCollectionTypeAdapter.java

public class DataCollectionTypeAdapter<T extends Data> extends TypeAdapter<DataCollection<T>> {

    @NonNull
    private TypeAdapter<Collection<T>> collectionTypeAdapter;

    public DataCollectionTypeAdapter(@NonNull TypeAdapter<T> typeAdapter) {

From source file com.gilecode.yagson.adapters.DefaultTypeAdapterRuntimeWrapper.java

/**
 * Type adapter wrapper with the advanced support of the type advices and the default types. Emits/use type advices only
 * when the runtime type differs from the default type.
 * <p/>
 * This wrapper may only be used when the type info is enabled.
 *

From source file com.gilecode.yagson.adapters.DelegatingTypeAdapter.java

/**
 * An abstract for type adapter wrappers with known delegates.
 * Once initialized, returns the same delegate on each call to {@link #getDelegate()} }
 *
 * @author Andrey Mogilev
 */