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 port of a switch. |
| 5 | */ |
| 6 | public class Port { |
| 7 | private short value; |
| 8 | |
| 9 | /** |
| 10 | * Default constructor. |
| 11 | */ |
| 12 | public Port() { |
| 13 | this.value = 0; |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Constructor from a long value. |
| 18 | * |
| 19 | * @param value the value to use. |
| 20 | */ |
| 21 | public Port(short value) { |
| 22 | this.value = value; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Get the value of the port. |
| 27 | * |
| 28 | * @return the value of the port. |
| 29 | */ |
| 30 | public short value() { return value; } |
| 31 | |
| 32 | /** |
| 33 | * Set the value of the port. |
| 34 | * |
| 35 | * @param value the value to set. |
| 36 | */ |
| 37 | public void setValue(short value) { |
| 38 | this.value = value; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Convert the port value to a string. |
| 43 | * |
| 44 | * @return the port value as a string. |
| 45 | */ |
| 46 | @Override |
| 47 | public String toString() { |
| 48 | String ret = ""; |
| 49 | // TODO: Implement it! |
| 50 | return ret; |
| 51 | } |
| 52 | } |