Example usage for com.google.gson JsonSerializer interface-usage

List of usage examples for com.google.gson JsonSerializer interface-usage

Introduction

In this page you can find the example usage for com.google.gson JsonSerializer interface-usage.

Usage

From source file com.github.naios.wide.config.internal.LazyGsonAdapter.java

public class LazyGsonAdapter<T> implements JsonSerializer<T>, JsonDeserializer<T> {
    private final Function<JsonElement, T> set;

    private final Function<T, JsonElement> get;

    public LazyGsonAdapter(final Function<JsonElement, T> set, final Function<T, JsonElement> get) {

From source file com.github.panthro.JSON.java

class DateAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {
    private final ApiClient apiClient;

    /**
     * Constructor for DateAdapter
     *

From source file com.github.piasy.base.model.jsr310.ZonedDateTimeJsonConverter.java

/**
 * GSON serialiser/deserialiser for converting {@link ZonedDateTime} objects.
 */
public class ZonedDateTimeJsonConverter implements JsonSerializer<ZonedDateTime>, JsonDeserializer<ZonedDateTime> {
    /** Formatter. */
    private final DateTimeFormatter mDateTimeFormatter;

From source file com.github.piasy.bootstrap.base.model.jsr310.ZonedDateTimeJsonConverter.java

/**
 * GSON serialiser/deserialiser for converting {@link ZonedDateTime} objects.
 */
public class ZonedDateTimeJsonConverter implements JsonSerializer<ZonedDateTime>, JsonDeserializer<ZonedDateTime> {
    /** Formatter. */
    private final DateTimeFormatter mDateTimeFormatter;

From source file com.github.piasy.common.android.utils.model.CustomZonedDateTimeConverter.java

/**
 * GSON serialiser/deserialiser for converting {@link ZonedDateTime} objects.
 */
public class CustomZonedDateTimeConverter
        implements JsonSerializer<ZonedDateTime>, JsonDeserializer<ZonedDateTime> {
    /** Formatter. */

From source file com.google.belay.server.CapabilityAdapter.java

/**
 * Gson adapter which can serialize and deserialize {@link Capability} objects
 * to and from the expected format in the bcap protocol.
 * 
 * @author Iain McGinniss (iainmcgin@google.com)
 */

From source file com.google.enterprise.adaptor.secmgr.json.ProxyTypeAdapter.java

/**
 * A type adapter for a given type that uses a proxy class for serialization.
 * The proxy is a class that will be serialized in place of the type.  An
 * instance of the type is serialized by converting it to an instance of the
 * proxy class by means of the proxy's one-argument constructor and then
 * serializing the proxy.  An instance of the type is deserialized by first

From source file com.google.gerrit.server.events.ProjectNameKeySerializer.java

public class ProjectNameKeySerializer implements JsonSerializer<Project.NameKey> {
    @Override
    public JsonElement serialize(Project.NameKey project, Type typeOfSrc, JsonSerializationContext context) {
        return new JsonPrimitive(project.get());
    }
}

From source file com.google.gerrit.server.events.SupplierSerializer.java

public class SupplierSerializer implements JsonSerializer<Supplier<?>> {

    @Override
    public JsonElement serialize(Supplier<?> src, Type typeOfSrc, JsonSerializationContext context) {
        return context.serialize(src.get());
    }

From source file com.google.gwtjsonrpc.server.MapDeserializer.java

public class MapDeserializer implements JsonDeserializer<Map<Object, Object>>, JsonSerializer<Map<Object, Object>>,
        InstanceCreator<Map<Object, Object>> {
    public Map<Object, Object> createInstance(final Type type) {
        return new HashMap<Object, Object>();
    }