Skip to content
Snippets Groups Projects
Commit 56e8d451 authored by hwchiu's avatar hwchiu
Browse files

Modify the Serializer for DPID (Long -> DatapathId )

parent 2b161f1a
No related branches found
No related tags found
No related merge requests found
......@@ -24,17 +24,17 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import org.projectfloodlight.openflow.util.HexString;
import org.projectfloodlight.openflow.types.DatapathId;
/**
* Serialize a DPID as colon-separated hexadecimal
*/
public class DPIDSerializer extends JsonSerializer<Long> {
public class DPIDSerializer extends JsonSerializer<DatapathId> {
@Override
public void serialize(Long dpid, JsonGenerator jGen,
public void serialize(DatapathId dpid, JsonGenerator jGen,
SerializerProvider serializer)
throws IOException, JsonProcessingException {
jGen.writeString(HexString.toHexString(dpid, 8));
jGen.writeString(HexString.toHexString(dpid.getLong(), 8));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment