Toshio Koide | b8cea26 | 2014-08-12 18:45:46 -0700 | [diff] [blame] | 1 | package net.onrc.onos.api.flowmanager; |
| 2 | |
Toshio Koide | b86338e | 2014-08-21 19:29:43 -0700 | [diff] [blame] | 3 | import java.util.Objects; |
| 4 | |
Toshio Koide | a7827bb | 2014-08-29 11:36:06 -0700 | [diff] [blame^] | 5 | import javax.annotation.concurrent.Immutable; |
| 6 | |
Toshio Koide | b8cea26 | 2014-08-12 18:45:46 -0700 | [diff] [blame] | 7 | /** |
| 8 | * Represents ID for {@link FlowBatchOperation}. |
Toshio Koide | a7827bb | 2014-08-29 11:36:06 -0700 | [diff] [blame^] | 9 | * <p> |
| 10 | * This class is immutable. |
Toshio Koide | b8cea26 | 2014-08-12 18:45:46 -0700 | [diff] [blame] | 11 | */ |
Toshio Koide | a7827bb | 2014-08-29 11:36:06 -0700 | [diff] [blame^] | 12 | @Immutable |
| 13 | public final class FlowBatchId { |
Toshio Koide | b86338e | 2014-08-21 19:29:43 -0700 | [diff] [blame] | 14 | 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 Koide | a7827bb | 2014-08-29 11:36:06 -0700 | [diff] [blame^] | 25 | return "0x" + Long.toHexString(id); |
Toshio Koide | b86338e | 2014-08-21 19:29:43 -0700 | [diff] [blame] | 26 | } |
| 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 Koide | b8cea26 | 2014-08-12 18:45:46 -0700 | [diff] [blame] | 37 | } |