blob: 0e69273286572e5aa92567f3759a97308af77ae6 [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.FlowId;
/**
* Serialize a Flow ID as a hexadecimal string.
*/
public class FlowIdSerializer extends JsonSerializer<FlowId> {
@Override
public void serialize(FlowId flowId, JsonGenerator jGen,
SerializerProvider serializer)
throws IOException, JsonProcessingException {
jGen.writeString(flowId.toString());
}
}