Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.matchaction; |
| 2 | |
Toshio Koide | fad1cd5 | 2014-08-07 17:10:07 -0700 | [diff] [blame] | 3 | import net.onrc.onos.api.batchoperation.BatchOperationTarget; |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 4 | |
Ray Milkey | c127a5a | 2014-08-20 11:22:12 -0700 | [diff] [blame] | 5 | /** |
| 6 | * A unique identifier for a MatchAction. Objects of this class are immutable. |
| 7 | */ |
Brian O'Connor | dee2e6b | 2014-08-12 11:34:51 -0700 | [diff] [blame] | 8 | public final class MatchActionId implements BatchOperationTarget { |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 9 | private final String value; |
| 10 | |
Ray Milkey | c127a5a | 2014-08-20 11:22:12 -0700 | [diff] [blame] | 11 | /** |
| 12 | * Creates a new Match Action Identifier based on the given id string. |
| 13 | * |
| 14 | * @param id unique id string |
| 15 | */ |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 16 | 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 Milkey | c127a5a | 2014-08-20 11:22:12 -0700 | [diff] [blame] | 34 | return (value.equals(other.value)); |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 35 | } |
| 36 | return false; |
| 37 | } |
| 38 | |
| 39 | } |