tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net; |
2 | |||||
3 | import java.net.URI; | ||||
4 | |||||
5 | /** | ||||
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 6 | * Immutable representation of a device identity. |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 7 | */ |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame] | 8 | public final class DeviceId extends ElementId { |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 9 | |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame] | 10 | // Public construction is prohibited |
11 | private DeviceId(URI uri) { | ||||
12 | super(uri); | ||||
13 | } | ||||
14 | |||||
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 15 | /** |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 16 | * Creates a device id using the supplied URI. |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 17 | * |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame] | 18 | * @param uri device URI |
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 19 | */ |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame] | 20 | public static DeviceId deviceId(URI uri) { |
21 | return new DeviceId(uri); | ||||
22 | } | ||||
23 | |||||
24 | /** | ||||
25 | * Creates a device id using the supplied URI string. | ||||
26 | * | ||||
27 | * @param string device URI string | ||||
28 | */ | ||||
29 | public static DeviceId deviceId(String string) { | ||||
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 30 | return deviceId(URI.create(string)); |
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 31 | } |
32 | |||||
tom | 0eb04ca | 2014-08-25 14:34:51 -0700 | [diff] [blame] | 33 | } |