Use Dpid class to represent DPID instead of Long for type safety

- Signatures of public methods are not changed
- Only private fields are changed to keep compatibility

Change-Id: I1d54fa54ede9b09439944cfb5f53564ff22ac339
diff --git a/src/main/java/net/onrc/onos/core/topology/SwitchEvent.java b/src/main/java/net/onrc/onos/core/topology/SwitchEvent.java
index 36cf8cf..16475f0 100644
--- a/src/main/java/net/onrc/onos/core/topology/SwitchEvent.java
+++ b/src/main/java/net/onrc/onos/core/topology/SwitchEvent.java
@@ -1,5 +1,7 @@
 package net.onrc.onos.core.topology;
 
+import net.onrc.onos.core.util.Dpid;
+
 import java.nio.ByteBuffer;
 
 /**
@@ -8,7 +10,7 @@
  * TODO: We probably want common base class/interface for Self-Contained Event Object.
  */
 public class SwitchEvent {
-    protected final Long dpid;
+    protected final Dpid dpid;
 
     /**
      * Default constructor for Serializer to use.
@@ -19,16 +21,16 @@
     }
 
     public SwitchEvent(Long dpid) {
-        this.dpid = dpid;
+        this.dpid = new Dpid(dpid);
     }
 
     public Long getDpid() {
-        return dpid;
+        return dpid.value();
     }
 
     @Override
     public String toString() {
-        return "[SwitchEvent 0x" + Long.toHexString(dpid) + "]";
+        return "[SwitchEvent 0x" + Long.toHexString(dpid.value()) + "]";
     }
 
     public static final int SWITCHID_BYTES = 2 + 8;
@@ -41,10 +43,10 @@
     }
 
     public byte[] getID() {
-        return getSwitchID(dpid).array();
+        return getSwitchID(dpid.value()).array();
     }
 
     public ByteBuffer getIDasByteBuffer() {
-        return getSwitchID(dpid);
+        return getSwitchID(dpid.value());
     }
 }