blob: 022e7c411227754fb706d8354bc28eb78946b4f1 [file] [log] [blame]
Toshio Koide4ea84192014-07-31 12:10:12 -07001package net.onrc.onos.api.batchoperation;
2
3public class TestBatchOperation extends
4 BatchOperation<BatchOperationEntry<TestBatchOperation.Operator, ?>> {
5
6 public enum Operator {
7 STRING,
8 INTEGER,
9 }
10
11 public static class StringTarget implements IBatchOperationTarget {
12 private String string;
13
14 public StringTarget(String string) {
15 this.string = string;
16 }
17
18 public String getString() {
19 return string;
20 }
21 }
22
23 public static class IntegerTarget implements IBatchOperationTarget {
24 private Integer integer;
25
26 public IntegerTarget(Integer integer) {
27 this.integer = integer;
28 }
29
30 public Integer getInteger() {
31 return integer;
32 }
33 }
34
35 public TestBatchOperation addStringOperation(String string) {
36 return (super.addOperation(new BatchOperationEntry<Operator, StringTarget>(
37 Operator.STRING, new StringTarget(string))) == null)
38 ? null : this;
39 }
40
41 public TestBatchOperation addIntegerOperation(Integer integer) {
42 return (super.addOperation(new BatchOperationEntry<Operator, IntegerTarget>(
43 Operator.INTEGER, new IntegerTarget(integer))) == null)
44 ? null : this;
45 }
46}