tom | 4c6606f | 2014-09-07 11:11:21 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.link; |
2 | |||||
3 | import org.onlab.onos.net.ConnectPoint; | ||||
tom | eadbb46 | 2014-09-07 16:10:19 -0700 | [diff] [blame] | 4 | import org.onlab.onos.net.Link; |
tom | 4c6606f | 2014-09-07 11:11:21 -0700 | [diff] [blame] | 5 | |
6 | /** | ||||
7 | * Default implementation of immutable link description entity. | ||||
8 | */ | ||||
9 | public class DefaultLinkDescription implements LinkDescription { | ||||
10 | |||||
tom | eadbb46 | 2014-09-07 16:10:19 -0700 | [diff] [blame] | 11 | private final ConnectPoint src; |
12 | private final ConnectPoint dst; | ||||
13 | private final Link.Type type; | ||||
tom | 4c6606f | 2014-09-07 11:11:21 -0700 | [diff] [blame] | 14 | |
15 | /** | ||||
16 | * Creates a link description using the supplied information. | ||||
17 | * | ||||
tom | eadbb46 | 2014-09-07 16:10:19 -0700 | [diff] [blame] | 18 | * @param src link source |
19 | * @param dst link destination | ||||
20 | * @param type link type | ||||
tom | 4c6606f | 2014-09-07 11:11:21 -0700 | [diff] [blame] | 21 | */ |
tom | eadbb46 | 2014-09-07 16:10:19 -0700 | [diff] [blame] | 22 | public DefaultLinkDescription(ConnectPoint src, ConnectPoint dst, Link.Type type) { |
tom | 4c6606f | 2014-09-07 11:11:21 -0700 | [diff] [blame] | 23 | this.src = src; |
24 | this.dst = dst; | ||||
tom | eadbb46 | 2014-09-07 16:10:19 -0700 | [diff] [blame] | 25 | this.type = type; |
tom | 4c6606f | 2014-09-07 11:11:21 -0700 | [diff] [blame] | 26 | } |
27 | |||||
28 | @Override | ||||
29 | public ConnectPoint src() { | ||||
30 | return src; | ||||
31 | } | ||||
32 | |||||
33 | @Override | ||||
34 | public ConnectPoint dst() { | ||||
35 | return dst; | ||||
36 | } | ||||
37 | |||||
tom | eadbb46 | 2014-09-07 16:10:19 -0700 | [diff] [blame] | 38 | @Override |
39 | public Link.Type type() { | ||||
tom | d176fc4 | 2014-09-08 00:12:30 -0700 | [diff] [blame] | 40 | return type; |
tom | eadbb46 | 2014-09-07 16:10:19 -0700 | [diff] [blame] | 41 | } |
42 | |||||
tom | 4c6606f | 2014-09-07 11:11:21 -0700 | [diff] [blame] | 43 | } |