Pavlin Radoslavov | 5363c2a | 2013-02-18 09:55:42 -0800 | [diff] [blame] | 1 | package net.floodlightcontroller.util; |
| 2 | |
| 3 | /** |
| 4 | * The class representing a network switch DPID. |
| 5 | */ |
| 6 | public 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 | } |