blob: 9c15d3137aac0abfa4f2b7c06ef4a8045cd41fd2 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.batchoperation;
2
3/**
Toshio Koide4ea84192014-07-31 12:10:12 -07004 * A super class for batch operation entry classes.
Toshio Koidea03915e2014-07-01 18:39:52 -07005 * <p>
Toshio Koide4ea84192014-07-31 12:10:12 -07006 * This is the interface to classes which are maintained by BatchOperation as
7 * its entries.
Toshio Koidea03915e2014-07-01 18:39:52 -07008 */
Toshio Koidefad1cd52014-08-07 17:10:07 -07009public class BatchOperationEntry<T extends Enum<?>, U extends BatchOperationTarget> {
Toshio Koide4ea84192014-07-31 12:10:12 -070010 private final T operator;
11 private final U target;
12
Toshio Koidea03915e2014-07-01 18:39:52 -070013 /**
Pavlin Radoslavov63559e92014-08-13 14:18:56 -070014 * Default constructor for serializer.
15 */
16 @Deprecated
17 protected BatchOperationEntry() {
18 this.operator = null;
19 this.target = null;
20 }
21
22 /**
Toshio Koide4ea84192014-07-31 12:10:12 -070023 * Constructs new instance for the entry of the BatchOperation.
Toshio Koidea03915e2014-07-01 18:39:52 -070024 *
Toshio Koide4ea84192014-07-31 12:10:12 -070025 * @param operator the operator of this operation
26 * @param target the target object of this operation
Toshio Koidea03915e2014-07-01 18:39:52 -070027 */
Toshio Koide4ea84192014-07-31 12:10:12 -070028 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 Koidea03915e2014-07-01 18:39:52 -070050}