blob: 31061bc20a22b43218e7bc25968bd8ca9544d641 [file] [log] [blame]
Pavlin Radoslavov5363c2a2013-02-18 09:55:42 -08001package net.floodlightcontroller.util;
2
3import net.floodlightcontroller.util.Dpid;
4import net.floodlightcontroller.util.Port;
5
6/**
7 * The class representing a Switch-Port.
8 */
9public class SwitchPort {
10 private Dpid dpid; // The DPID of the switch
11 private Port port; // The port of the switch
12
13 /**
14 * Default constructor.
15 */
16 public SwitchPort() {
17 }
18
19 /**
20 * Constructor for a given DPID and a port.
21 *
22 * @param dpid the DPID to use.
23 * @param port the port to use.
24 */
25 public SwitchPort(Dpid dpid, Port port) {
26 this.dpid = dpid;
27 this.port = port;
28 }
29
30 /**
31 * Get the DPID value of the Switch-Port.
32 *
33 * @return the DPID value of the Switch-Port.
34 */
35 public Dpid dpid() { return dpid; }
36
37 /**
38 * Get the port value of the Switch-Port.
39 *
40 * @return the port value of the Switch-Port.
41 */
42 public Port port() { return port; }
43
44 /**
45 * Set the DPID and port values of the Switch-Port.
46 *
47 * @param dpid the DPID to use.
48 * @param port the port to use.
49 */
50 public void setValue(Dpid dpid, Port port) {
51 this.dpid = dpid;
52 this.port = port;
53 }
54
55 /**
56 * Convert the Switch-Port value to a string.
57 *
58 * @return the Switch-Port value as a string.
59 */
60 @Override
61 public String toString() {
62 String ret = "";
63 // TODO: Implement it!
64 return ret;
65 }
66}