blob: 219f7797d67e8f5bedeccf4a8680d2f9151ef740 [file] [log] [blame]
Toshio Koideb8cea262014-08-12 18:45:46 -07001package net.onrc.onos.api.flowmanager;
2
Toshio Koideb86338e2014-08-21 19:29:43 -07003import java.util.Objects;
4
Toshio Koidea7827bb2014-08-29 11:36:06 -07005import javax.annotation.concurrent.Immutable;
6
Toshio Koideb8cea262014-08-12 18:45:46 -07007/**
8 * Represents ID for {@link FlowBatchOperation}.
Toshio Koidea7827bb2014-08-29 11:36:06 -07009 * <p>
10 * This class is immutable.
Toshio Koideb8cea262014-08-12 18:45:46 -070011 */
Toshio Koidea7827bb2014-08-29 11:36:06 -070012@Immutable
13public final class FlowBatchId {
Toshio Koideb86338e2014-08-21 19:29:43 -070014 private final long id;
15
16 /**
17 * Creates a new FlowBatchId object using long value.
18 */
19 public FlowBatchId(long id) {
20 this.id = id;
21 }
22
23 @Override
24 public String toString() {
Toshio Koidea7827bb2014-08-29 11:36:06 -070025 return "0x" + Long.toHexString(id);
Toshio Koideb86338e2014-08-21 19:29:43 -070026 }
27
28 @Override
29 public int hashCode() {
30 return Objects.hashCode(id);
31 }
32
33 @Override
34 public boolean equals(Object obj) {
35 return (obj instanceof FlowBatchId) ? id == ((FlowBatchId) obj).id : false;
36 }
Toshio Koideb8cea262014-08-12 18:45:46 -070037}