tom | 80c0e5e | 2014-09-08 18:08:58 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net; |
| 2 | |
| 3 | import java.net.URI; |
| 4 | |
| 5 | /** |
| 6 | * Immutable representation of a host identity. |
| 7 | */ |
| 8 | public final class HostId extends ElementId { |
| 9 | |
| 10 | // Public construction is prohibited |
| 11 | private HostId(URI uri) { |
| 12 | super(uri); |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Creates a device id using the supplied URI. |
| 17 | * |
| 18 | * @param uri device URI |
| 19 | */ |
| 20 | public static HostId hostId(URI uri) { |
| 21 | return new HostId(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 HostId hostId(String string) { |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 30 | return hostId(URI.create(string)); |
tom | 80c0e5e | 2014-09-08 18:08:58 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | } |