blob: 2518e86ee899dda9d03f3f82a6e0ba1f6e75b2aa [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.FlowEntryErrorState;
/**
* Serialize a Flow Entry Error State as a string.
*/
public class FlowEntryErrorStateSerializer extends JsonSerializer<FlowEntryErrorState> {
@Override
public void serialize(FlowEntryErrorState flowEntryErrorState,
JsonGenerator jGen, SerializerProvider serializer)
throws IOException, JsonProcessingException {
jGen.writeStartObject();
jGen.writeNumberField("type", flowEntryErrorState.type());
jGen.writeNumberField("code", flowEntryErrorState.code());
jGen.writeEndObject();
}
}