blob: b52043941c7c0e3c61bd2b3ea1cdbac7436c527f [file] [log] [blame]
Toshio Koide025a9152014-07-21 11:00:34 -07001package net.onrc.onos.core.matchaction;
2
Toshio Koidefad1cd52014-08-07 17:10:07 -07003import net.onrc.onos.api.batchoperation.BatchOperationTarget;
Toshio Koide025a9152014-07-21 11:00:34 -07004
Ray Milkeyc127a5a2014-08-20 11:22:12 -07005/**
6 * A unique identifier for a MatchAction. Objects of this class are immutable.
7 */
Brian O'Connordee2e6b2014-08-12 11:34:51 -07008public final class MatchActionId implements BatchOperationTarget {
Toshio Koide025a9152014-07-21 11:00:34 -07009 private final String value;
10
Ray Milkeyc127a5a2014-08-20 11:22:12 -070011 /**
12 * Creates a new Match Action Identifier based on the given id string.
13 *
14 * @param id unique id string
15 */
Toshio Koide025a9152014-07-21 11:00:34 -070016 public MatchActionId(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 MatchActionId) {
33 MatchActionId other = (MatchActionId) obj;
Ray Milkeyc127a5a2014-08-20 11:22:12 -070034 return (value.equals(other.value));
Toshio Koide025a9152014-07-21 11:00:34 -070035 }
36 return false;
37 }
38
39}