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.yandex.money.api.typeadapters.model.NumericCurrencyTypeAdapter.java

public final class NumericCurrencyTypeAdapter extends TypeAdapter<Currency> {

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

From source file cz.kovar.petr.homevoice.zwave.utils.BooleanTypeAdapter.java

public class BooleanTypeAdapter extends TypeAdapter<Boolean> {

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

From source file de.dentrassi.eclipse.provider.eclipse.ValueAdapter.java

public class ValueAdapter extends TypeAdapter<String> {

    @Override
    public void write(final JsonWriter out, final String value) throws IOException {
        if (value != null) {
            out.beginArray();

From source file de.dentrassi.iot.opentsdb.collector.http.gson.DataTypeAdapter.java

public class DataTypeAdapter extends TypeAdapter<Data> {

    private final ToLongFunction<Instant> timestampProvider;

    public DataTypeAdapter(final boolean milliseconds) {
        if (milliseconds) {

From source file de.dentrassi.pm.maven.ByteArrayAdapter.java

public class ByteArrayAdapter extends TypeAdapter<byte[]> {

    @Override
    public byte[] read(final JsonReader reader) throws IOException {
        if (reader.peek() == JsonToken.NULL) {
            reader.nextNull();

From source file de.feike.tiingoclient.JSON.java

/**
 * Gson TypeAdapter for Joda DateTime type
 */
class DateTimeTypeAdapter extends TypeAdapter<DateTime> {

    private final DateTimeFormatter parseFormatter = ISODateTimeFormat.dateOptionalTimeParser();

From source file de.m0ep.canvas.gson.ISO8601TypeAdapter.java

/**
 * Typeadapter for GSON to convert the Canvas date format to a Java {@link Date}
 * object.
 * 
 * @author Florian Mller
 * 

From source file dk.ilios.spanner.json.InstantTypeAdapter.java

/**
 * Serializes and deserializes {@code Instant} instances.
 */
public final class InstantTypeAdapter extends TypeAdapter<Instant> {

    @Override

From source file edu.cad.utils.gson.HibernateProxyTypeAdapter.java

public class HibernateProxyTypeAdapter extends TypeAdapter<HibernateProxy> {

    public static final TypeAdapterFactory FACTORY = new TypeAdapterFactory() {
        @Override
        @SuppressWarnings("unchecked")
        public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {

From source file edu.isi.pegasus.planner.code.generator.condor.CondorGenerator.java

class GraphNodeGSONAdapter extends TypeAdapter<GraphNode> {

    @Override
    public void write(JsonWriter writer, GraphNode node) throws IOException {
        writer.beginObject();
        Object content = node.getContent();