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 org.cgiar.ccafs.marlo.utils.LongTypeAdapter.java

public class LongTypeAdapter extends TypeAdapter<Long> {

    @Override
    public Long read(JsonReader reader) throws IOException {
        if (reader.peek() == JsonToken.NULL) {
            reader.nextNull();

From source file org.cgiar.ccafs.marlo.utils.StringTypeAdapter.java

/**
 * @author Hermes Jimnez - CIAT/CCAFS
 */
public class StringTypeAdapter extends TypeAdapter<String> {

    @Override

From source file org.coursera.courier.android.adapters.CustomIntAdapter.java

public class CustomIntAdapter extends TypeAdapter<CustomInt> {

    @Override
    public void write(JsonWriter out, CustomInt value) throws IOException {
        out.value(value.value());
    }

From source file org.coursera.courier.android.adapters.DateTimeAdapter.java

public class DateTimeAdapter extends TypeAdapter<DateTime> {

    @Override
    public void write(JsonWriter out, DateTime value) throws IOException {
        out.value(value.getMillis());
    }

From source file org.diorite.config.serialization.JsonStringSerializerImpl.java

class JsonStringSerializerImpl<T> extends TypeAdapter<T> {
    private final StringSerializer<T> stringSerializer;

    JsonStringSerializerImpl(StringSerializer<T> stringSerializer) {
        this.stringSerializer = stringSerializer;
    }

From source file org.eclipse.epp.internal.logging.aeri.ui.utils.UuidTypeAdapter.java

public class UuidTypeAdapter extends TypeAdapter<UUID> {

    @Override
    public void write(JsonWriter out, UUID value) throws IOException {
        if (value == null) {
            out.nullValue();

From source file org.eclipse.lsp4j.adapters.HoverTypeAdapter.java

/**
 * A type adapter for the Hover protocol type.
 */
@TypeAdapterImpl(Hover.class)
@SuppressWarnings("all")
public class HoverTypeAdapter extends TypeAdapter<Hover> {

From source file org.eclipse.lsp4j.adapters.InitializeParamsTypeAdapter.java

/**
 * A type adapter for the InitializeParams protocol type.
 */
@TypeAdapterImpl(InitializeParams.class)
@SuppressWarnings("all")
public class InitializeParamsTypeAdapter extends TypeAdapter<InitializeParams> {

From source file org.eclipse.lsp4j.adapters.VersionedTextDocumentIdentifierTypeAdapter.java

/**
 * A type adapter for the VersionedTextDocumentIdentifier protocol type.
 */
@TypeAdapterImpl(VersionedTextDocumentIdentifier.class)
@SuppressWarnings("all")
public class VersionedTextDocumentIdentifierTypeAdapter extends TypeAdapter<VersionedTextDocumentIdentifier> {

From source file org.eclipse.lsp4j.jsonrpc.debug.adapters.DebugEnumTypeAdapter.java

public class DebugEnumTypeAdapter<T extends Enum<T>> extends TypeAdapter<T> {
    public static class Factory implements TypeAdapterFactory {
        @Override
        @SuppressWarnings({ "unchecked", "rawtypes" })
        public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
            Class<?> rawType = typeToken.getRawType();