blob: f23ad6d3812839f23c95e779c011f53ce9079de0 [file] [log] [blame]
jccfff0de92015-03-28 01:40:08 -07001package org.onosproject.net.resource;
2
3import java.util.Objects;
4
5/**
6 * Representation of a label.
7 */
8public final class LabelResourceId implements ResourceId {
9
10 private long labelId;
11
12 public static LabelResourceId labelResourceId(long labelResourceId) {
13 return new LabelResourceId(labelResourceId);
14 }
15
16 // Public construction is prohibited
17 private LabelResourceId(long labelId) {
18 this.labelId = labelId;
19 }
20
21 public long labelId() {
22 return labelId;
23 }
24
25 @Override
26 public int hashCode() {
27 return Objects.hashCode(labelId);
28 }
29
30 @Override
31 public boolean equals(Object obj) {
32 if (obj instanceof LabelResourceId) {
33 LabelResourceId that = (LabelResourceId) obj;
34 return Objects.equals(this.labelId, that.labelId);
35 }
36 return false;
37 }
38
39 @Override
40 public String toString() {
41 return String.valueOf(this.labelId);
42 }
43
44}