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 co.cask.cdap.common.stream.StreamEventTypeAdapter.java

/**
 * A GSon {@link TypeAdapter} for serializing/deserializing {@link StreamEvent} to/from JSON. It serializes
 *
 * StreamEvent into
 * <p>
 * {@code {"timestamp": ... , "headers": { ... }, "body": ... }}

From source file co.cask.cdap.gateway.handlers.log.LogOffsetAdapter.java

/**
*
*/
public final class LogOffsetAdapter extends TypeAdapter<LogOffset> {
    @Override
    public void write(JsonWriter out, LogOffset value) throws IOException {

From source file co.cask.cdap.internal.io.SchemaTypeAdapter.java

/**
 * Class for serialize/deserialize Schema object to/from json through {@link com.google.gson.Gson Gson}.
 * <p>
 *  Expected usage:
 *
 *  <pre>

From source file co.cask.common.internal.io.SchemaTypeAdapter.java

/**
 * Class for serialize/deserialize Schema object to/from json through {@link com.google.gson.Gson Gson}.
 * <p>
 *  Expected usage:
 *
 *  <pre>

From source file co.cask.tigon.internal.io.SchemaTypeAdapter.java

/**
 * Class for serialize/deserialize Schema object to/from json through {@link com.google.gson.Gson Gson}.
 * <p>
 *  Expected usage:
 *
 *  <pre>

From source file co.forsaken.projectindigo.utils.mojangtokens.FileTypeAdapter.java

public class FileTypeAdapter extends TypeAdapter<File> {

    @Override
    public File read(JsonReader json) throws IOException {
        if (json.hasNext()) {
            String value = json.nextString();

From source file co.uk.crowdemotion.JSON.java

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

    private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime();

From source file co.waitlisted.JSON.java

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

    private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime();

From source file com.actimem.blog.gson.custometypeannotation.CompanyIdTypeAdapter.java

public class CompanyIdTypeAdapter extends TypeAdapter<CompanyId> {
    @Override
    public void write(JsonWriter out, CompanyId value) throws IOException {
        out.value(value.getId());
    }

From source file com.actimem.blog.gson.custometypeannotation.DateTimeTypeAdapter.java

public class DateTimeTypeAdapter extends TypeAdapter<DateTime> {
    @Override
    public void write(JsonWriter out, DateTime value) throws IOException {
        out.value(value.toString());
    }