All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.basho.riak.client.api.commands.mapreduce.LinkPhaseSerializer Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
package com.basho.riak.client.api.commands.mapreduce;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

/**
 * Serializes a {@link LinkPhase} to a Riak MapReduce JSON format.
 */
class LinkPhaseSerializer extends JsonSerializer
{
	@Override
	public void serialize(LinkPhase phase, JsonGenerator jg, SerializerProvider sp) throws IOException
	{
		jg.writeStartObject();
		jg.writeFieldName(phase.getType().toString());

		jg.writeStartObject();
		jg.writeStringField("bucket", phase.getBucket());
		jg.writeStringField("tag", phase.getTag());
		jg.writeEndObject();

		jg.writeEndObject();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy