Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 1 | package net.onrc.onos.api.batchoperation; |
| 2 | |
| 3 | /** |
Toshio Koide | 4ea8419 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 4 | * A super class for batch operation entry classes. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 5 | * <p> |
Toshio Koide | 4ea8419 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 6 | * This is the interface to classes which are maintained by BatchOperation as |
| 7 | * its entries. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 8 | */ |
Toshio Koide | fad1cd5 | 2014-08-07 17:10:07 -0700 | [diff] [blame] | 9 | public class BatchOperationEntry<T extends Enum<?>, U extends BatchOperationTarget> { |
Toshio Koide | 4ea8419 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 10 | private final T operator; |
| 11 | private final U target; |
| 12 | |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 13 | /** |
Pavlin Radoslavov | 63559e9 | 2014-08-13 14:18:56 -0700 | [diff] [blame^] | 14 | * Default constructor for serializer. |
| 15 | */ |
| 16 | @Deprecated |
| 17 | protected BatchOperationEntry() { |
| 18 | this.operator = null; |
| 19 | this.target = null; |
| 20 | } |
| 21 | |
| 22 | /** |
Toshio Koide | 4ea8419 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 23 | * Constructs new instance for the entry of the BatchOperation. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 24 | * |
Toshio Koide | 4ea8419 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 25 | * @param operator the operator of this operation |
| 26 | * @param target the target object of this operation |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 27 | */ |
Toshio Koide | 4ea8419 | 2014-07-31 12:10:12 -0700 | [diff] [blame] | 28 | public BatchOperationEntry(T operator, U target) { |
| 29 | this.operator = operator; |
| 30 | this.target = target; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Gets the target object of this operation. |
| 35 | * |
| 36 | * @return the target object of this operation |
| 37 | */ |
| 38 | public U getTarget() { |
| 39 | return target; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Gets the operator of this operation. |
| 44 | * |
| 45 | * @return the operator of this operation |
| 46 | */ |
| 47 | public T getOperator() { |
| 48 | return operator; |
| 49 | } |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 50 | } |