blob: 9d1f0ed1e8538659a303d1d814592c43752788dc [file] [log] [blame]
Toshio Koide025a9152014-07-21 11:00:34 -07001package net.onrc.onos.api.flowmanager;
2
Toshio Koidefad1cd52014-08-07 17:10:07 -07003import net.onrc.onos.api.batchoperation.BatchOperationTarget;
Toshio Koide025a9152014-07-21 11:00:34 -07004
5/**
Toshio Koide7894ca02014-08-15 14:30:13 -07006 * Represents ID for Flow objects.
Toshio Koide025a9152014-07-21 11:00:34 -07007 */
Toshio Koidefad1cd52014-08-07 17:10:07 -07008public class FlowId implements BatchOperationTarget {
Toshio Koide025a9152014-07-21 11:00:34 -07009 private final String value;
10
11 /**
12 * Creates new instance with string ID.
13 *
14 * @param id String representation of the ID.
15 */
16 public FlowId(String id) {
17 value = id;
18 }
19
20 @Override
21 public String toString() {
22 return value;
23 }
24
25 @Override
26 public int hashCode() {
27 return value.hashCode();
28 }
29
30 @Override
31 public boolean equals(Object obj) {
32 if (obj instanceof FlowId) {
33 FlowId other = (FlowId) obj;
34 return (this.value.equals(other.value));
35 }
36 return false;
37 }
38}