blob: 3a8d1e89289c96e6c0b8bae087002a6b9efb9878 [file] [log] [blame]
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08001package net.floodlightcontroller.util;
2
3/**
4 * The class representing a network switch DPID.
5 */
6public class Dpid {
7 static public long UNKNOWN = 0;
8
9 private long value;
10
11 /**
12 * Default constructor.
13 */
14 public Dpid() {
15 this.value = Dpid.UNKNOWN;
16 }
17
18 /**
19 * Constructor from a long value.
20 *
21 * @param value the value to use.
22 */
23 public Dpid(long value) {
24 this.value = value;
25 }
26
27 /**
28 * Get the value of the DPID.
29 *
30 * @return the value of the DPID.
31 */
32 public long value() { return value; }
33
34 /**
35 * Set the value of the DPID.
36 *
37 * @param value the value to set.
38 */
39 public void setValue(long value) {
40 this.value = value;
41 }
42
43 /**
44 * Convert the DPID value to a ':' separated hex string.
45 *
46 * @return the DPID value as a ':' separated hex string.
47 */
48 @Override
49 public String toString() {
50 String ret = "";
51 // TODO: Implement it!
52 return ret;
53 }
54}