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.dracade.ember.core.adapters.ClassAdapter.java

public class ClassAdapter extends TypeAdapter<Class> {

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

From source file com.dracade.ember.core.adapters.WorldAdapter.java

public class WorldAdapter extends TypeAdapter<World> {

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

From source file com.ecwid.mailchimp.internal.gson.MailChimpObjectTypeAdapter.java

/**
 *
 * @author Vasily Karyaev <v.karyaev@gmail.com>
 */
class MailChimpObjectTypeAdapter extends TypeAdapter<MailChimpObject> {

From source file com.epickrram.romero.server.web.RunningJobTypeAdapter.java

public final class RunningJobTypeAdapter extends TypeAdapter<RunningJob<?>> {
    @Override
    public void write(final JsonWriter jsonWriter, final RunningJob<?> runningJob) throws IOException {
        jsonWriter.beginObject();
        jsonWriter.name("jobKey");
        jsonWriter.value(runningJob.getJobKey().toString());

From source file com.epickrram.romero.testing.server.web.CompletedJobRunIdentifierTypeAdapter.java

final class CompletedJobRunIdentifierTypeAdapter extends TypeAdapter<CompletedJobRunIdentifier> {
    @Override
    public void write(final JsonWriter jsonWriter, final CompletedJobRunIdentifier completedJobRunIdentifier)
            throws IOException {
        throw new IllegalStateException("This TypeAdapter cannot be used for writing " + completedJobRunIdentifier);
    }

From source file com.fixmyfolks.app.DateTypeAdapter.java

/**
 * Adapter for Date. Although this class appears stateless, it is not.
 * DateFormat captures its time zone and locale when it is created, which gives
 * this class state. DateFormat isn't thread safe either, so this class has
 * to synchronize its read and write methods.
 */

From source file com.flexcore.hibernate.config.HibernateProxyTypeAdapter.java

/**
 *
 * @author Oscar Montes
 */
public class HibernateProxyTypeAdapter extends TypeAdapter<HibernateProxy> {

From source file com.flipkart.android.proteus.gson.CustomValueTypeAdapter.java

/**
 * CustomValueTypeAdapter
 *
 * @author adityasharat
 */
public abstract class CustomValueTypeAdapter<V extends Value> extends TypeAdapter<V> {

From source file com.flipkart.batchdemo.adapter.CustomTagDataAdapter.java

public class CustomTagDataAdapter extends TypeAdapter<CustomTagData> {

    private TypeAdapter<Tag> tagTypeAdapter;
    private final Gson gson = new Gson();

    public CustomTagDataAdapter() {

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

public final class SizeBatchTypeAdapter<T extends Data> extends TypeAdapter<SizeBatch<T>> {
    private final TypeAdapter<DataCollection<T>> typeAdapter;

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