blob: ef8c5ab1cec68e3b6c1cd7c476889e1f937e7909 [file] [log] [blame]
tom0eb04ca2014-08-25 14:34:51 -07001package org.onlab.onos.net;
2
3import java.net.URI;
4
5/**
tom64b7aac2014-08-26 00:18:21 -07006 * Immutable representation of a device identity.
tom0eb04ca2014-08-25 14:34:51 -07007 */
tomca20e0c2014-09-03 23:22:24 -07008public final class DeviceId extends ElementId {
tom0eb04ca2014-08-25 14:34:51 -07009
tomca20e0c2014-09-03 23:22:24 -070010 // Public construction is prohibited
11 private DeviceId(URI uri) {
12 super(uri);
13 }
14
tom0eb04ca2014-08-25 14:34:51 -070015 /**
tomb36046e2014-08-27 00:22:24 -070016 * Creates a device id using the supplied URI.
tom0eb04ca2014-08-25 14:34:51 -070017 *
tomca20e0c2014-09-03 23:22:24 -070018 * @param uri device URI
tom0eb04ca2014-08-25 14:34:51 -070019 */
tomca20e0c2014-09-03 23:22:24 -070020 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) {
tom568581d2014-09-08 20:13:36 -070030 return deviceId(URI.create(string));
tom64b7aac2014-08-26 00:18:21 -070031 }
32
tom0eb04ca2014-08-25 14:34:51 -070033}