blob: 8936954a56f7671c92a56abc76c5a63db69e429a [file] [log] [blame]
Brian O'Connor6de2e202015-05-21 14:30:41 -07001package org.onosproject.incubator.net.resource.label;
2
Brian O'Connord3c61df2015-06-25 15:07:04 -04003import com.google.common.annotations.Beta;
Brian O'Connor6de2e202015-05-21 14:30:41 -07004import org.onosproject.net.resource.ResourceId;
jccfff0de92015-03-28 01:40:08 -07005
6import java.util.Objects;
7
8/**
9 * Representation of a label.
10 */
Brian O'Connord3c61df2015-06-25 15:07:04 -040011@Beta
jccfff0de92015-03-28 01:40:08 -070012public final class LabelResourceId implements ResourceId {
13
14 private long labelId;
15
16 public static LabelResourceId labelResourceId(long labelResourceId) {
17 return new LabelResourceId(labelResourceId);
18 }
19
20 // Public construction is prohibited
21 private LabelResourceId(long labelId) {
22 this.labelId = labelId;
23 }
24
25 public long labelId() {
26 return labelId;
27 }
28
29 @Override
30 public int hashCode() {
31 return Objects.hashCode(labelId);
32 }
33
34 @Override
35 public boolean equals(Object obj) {
36 if (obj instanceof LabelResourceId) {
37 LabelResourceId that = (LabelResourceId) obj;
38 return Objects.equals(this.labelId, that.labelId);
39 }
40 return false;
41 }
42
43 @Override
44 public String toString() {
45 return String.valueOf(this.labelId);
46 }
47
48}