blob: 00f4d61e3a3df46633355636a0b01ebe8539c93c [file] [log] [blame]
HIGUCHI Yutaf086d8a2013-06-12 15:26:35 -07001package net.onrc.onos.ofcontroller.util.serializers;
Pavlin Radoslavovad008e02013-02-21 18:42:42 -08002
3import java.io.IOException;
4
5import org.codehaus.jackson.JsonGenerator;
6import org.codehaus.jackson.JsonProcessingException;
7import org.codehaus.jackson.map.JsonSerializer;
8import org.codehaus.jackson.map.SerializerProvider;
9
HIGUCHI Yuta356086e2013-06-12 15:21:19 -070010import net.onrc.onos.ofcontroller.util.FlowEntryId;
Pavlin Radoslavovad008e02013-02-21 18:42:42 -080011
12/**
13 * Serialize a Flow Entry ID as a hexadecimal string.
14 */
15public class FlowEntryIdSerializer extends JsonSerializer<FlowEntryId> {
16
17 @Override
18 public void serialize(FlowEntryId flowEntryId, JsonGenerator jGen,
19 SerializerProvider serializer)
20 throws IOException, JsonProcessingException {
21 jGen.writeString(flowEntryId.toString());
22 }
23}