blob: a6a5405ef7cab029ec628228c389c0684c28f371 [file] [log] [blame]
package net.floodlightcontroller.util.serializers;
import java.io.IOException;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;
import net.floodlightcontroller.util.FlowPath;
/**
* Serialize a FlowPath as a string.
*/
public class FlowPathSerializer extends JsonSerializer<FlowPath> {
@Override
public void serialize(FlowPath flowPath,
JsonGenerator jGen, SerializerProvider serializer)
throws IOException, JsonProcessingException {
jGen.writeStartObject();
jGen.writeObjectField("flowId", flowPath.flowId());
jGen.writeObjectField("installerId", flowPath.installerId());
jGen.writeObjectField("dataPath", flowPath.dataPath());
jGen.writeEndObject();
}
}