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.prayer.vakit.times.gson.BooleanSerializer.java

public class BooleanSerializer implements JsonSerializer<Boolean>, JsonDeserializer<Boolean> {

    @Override
    public JsonElement serialize(Boolean arg0, Type arg1, JsonSerializationContext arg2) {
        return arg0 ? new JsonPrimitive(1) : null;
    }

From source file com.reactive.hzdfs.utils.AbstractJsonSerializer.java

/**
 * Abstract class for custom json serializing of objects using Google Gson.
 * @see JsonSerializer
 * @param <T>
 */
public abstract class AbstractJsonSerializer<T> implements JsonSerializer<T> {

From source file com.reactivetechnologies.platform.utils.AbstractJsonSerializer.java

/**
 * Abstract class for custom json serializing of objects using Google Gson.
 * @see JsonSerializer
 * @param <T>
 */
public abstract class AbstractJsonSerializer<T> implements JsonSerializer<T> {

From source file com.redhat.tools.nexus.serial.DateToFileMapTypeAdapter.java

public class DateToFileMapTypeAdapter implements JsonSerializer<TreeMap<Date, File>>,
        JsonDeserializer<TreeMap<Date, File>>, InstanceCreator<TreeMap<Date, File>>, Converter {

    private static final String DATE_PROP = "date";

    private static final String FILE_PROP = "file";

From source file com.relayrides.pushy.apns.DateAsMillisecondsSinceEpochTypeAdapter.java

class DateAsMillisecondsSinceEpochTypeAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {

    @Override
    public Date deserialize(final JsonElement json, final Type typeOfT, final JsonDeserializationContext context)
            throws JsonParseException {
        final Date date;

From source file com.relayrides.pushy.apns.DateAsSecondsSinceEpochTypeAdapter.java

class DateAsSecondsSinceEpochTypeAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {

    @Override
    public Date deserialize(final JsonElement json, final Type typeOfT, final JsonDeserializationContext context)
            throws JsonParseException {
        final Date date;

From source file com.relayrides.pushy.apns.DateAsTimeSinceEpochTypeAdapter.java

/**
 * Converts {@link java.util.Date} instances in JSON objects to or from timestamps since the epoch.
 *
 * @author <a href="https://github.com/jchambers">Jon Chambers</a>
 */
class DateAsTimeSinceEpochTypeAdapter implements JsonSerializer<Date>, JsonDeserializer<Date> {

From source file com.reveldigital.api.util.ByteArrayTypeAdapter.java

/**
 * Created by Mike on 12/23/2014.
 */
public class ByteArrayTypeAdapter implements JsonSerializer<byte[]>, JsonDeserializer<byte[]> {
    public byte[] deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context)
            throws JsonParseException {

From source file com.reveldigital.api.util.DateTypeFormatter.java

/**
 * Formatter for date formats present in the RevelDigital API.
 */
public class DateTypeFormatter implements JsonDeserializer<Date>, JsonSerializer<Date> {

    private final String DATE_TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'"; //$NON-NLS-1$

From source file com.ruesga.rview.gerrit.adapters.GerritBas64Adapter.java

public class GerritBas64Adapter implements JsonDeserializer<Base64Data>, JsonSerializer<Base64Data> {

    private final PlatformAbstractionLayer mAbstractionLayer;

    public GerritBas64Adapter(PlatformAbstractionLayer abstractionLayer) {
        mAbstractionLayer = abstractionLayer;