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.phdcc.homehealth.Hapi.java

class MyTypeAdapter<T> extends TypeAdapter<T> {

    @Override
    public void write(JsonWriter writer, T obj) throws IOException {
        if (obj == null) {
            writer.nullValue();

From source file com.polydeucesys.eslogging.log4j.LoggingEventTypeAdapter.java

/**
 * Write only Gson type adapter for serialization of {@link LoggingEvent} instances.
 */
public class LoggingEventTypeAdapter extends TypeAdapter<LoggingEvent> {

    @Override

From source file com.polydeucesys.eslogging.log4j2.PropertyCarryLogEventWrapperTypeAdapter.java

/**
 * A write only Gson {@link TypeAdapter} for serializing {@link PropertyCarryLogEventWrapper} instances
 */
public class PropertyCarryLogEventWrapperTypeAdapter extends TypeAdapter<PropertyCarryLogEventWrapper> {

    private static final String WRITE_ONLY_ADAPTER = "Only write operations should be used in the LogAppender";

From source file com.polydeucesys.eslogging.logback.ILoggingEventTypeAdapter.java

/**
 * A write only Gson {@link TypeAdapter} for serializing {@link ILoggingEvent} instances
 */
public class ILoggingEventTypeAdapter extends TypeAdapter<ILoggingEvent> implements LifeCycle {
    private final RootCauseFirstThrowableProxyConverter throwableProxyConverter = new RootCauseFirstThrowableProxyConverter();

From source file com.qdeve.oilprice.configuration.GsonMoneyTypeAdapter.java

/**
 * Custom GSON adapter for {@link Money} type.
 *
 * @author Roman Krysinski
 */
public class GsonMoneyTypeAdapter extends TypeAdapter<Money> {

From source file com.redhat.thermostat.gateway.common.mongodb.response.LongTypeAdapter.java

public class LongTypeAdapter extends TypeAdapter<Long> {

    private static final String NUMBER_LONG_IDENTIFIER = "$numberLong";

    @Override
    public void write(JsonWriter out, Long value) throws IOException {

From source file com.redhat.thermostat.gateway.service.commands.channel.coders.typeadapters.BasicMessageTypeAdapter.java

abstract class BasicMessageTypeAdapter<T extends Message> extends TypeAdapter<T> {

    private static final String RESPONSE_TYPE_KEY = "respType";
    protected final Gson gson;

    BasicMessageTypeAdapter(Gson gson) {

From source file com.replaymod.replaystudio.pathing.serialize.LegacyKeyframeSetAdapter.java

public class LegacyKeyframeSetAdapter extends TypeAdapter<KeyframeSet[]> {

    public LegacyKeyframeSetAdapter() {
        super();
    }

From source file com.sailthru.client.NullSerializingMapTypeAdapter.java

/**
 *
 * @author ianwhite
 */
public class NullSerializingMapTypeAdapter extends TypeAdapter<Map<String, ?>> {
    final Gson gson = new GsonBuilder().serializeNulls().create();

From source file com.sauzny.gradlejava.cognitivej.identify.tools.ClassTypeAdapter.java

public class ClassTypeAdapter extends TypeAdapter<Class<?>> {
    @Override
    public void write(JsonWriter jsonWriter, Class<?> clazz) throws IOException {
        if (clazz == null) {
            jsonWriter.nullValue();
            return;