blob: 57d2667ddbee72fdb5483cf77a97ca4376b938a1 [file] [log] [blame]
Toshio Koideb609b3b2014-02-14 18:25:52 -08001package net.onrc.onos.intent;
2
3/**
4 * @author Toshio Koide (t-koide@onlab.us)
5 */
6public class IntentOperation {
7 public enum Operator {
8 /**
Toshio Koidedf2eab92014-02-20 11:24:59 -08009 * Add new intent specified by intent field.
Toshio Koideb609b3b2014-02-14 18:25:52 -080010 */
11 ADD,
12
13 /**
14 * Remove existing intent specified by intent field.
Toshio Koidedf2eab92014-02-20 11:24:59 -080015 * The instance of intent field should be an instance of Intent class (not a child class)
Toshio Koideb609b3b2014-02-14 18:25:52 -080016 */
17 REMOVE,
Toshio Koidedf2eab92014-02-20 11:24:59 -080018
19 /**
20 * Do error handling.
21 * The instance of intent field should be an instance of ErrorIntent
22 */
23 ERROR,
Toshio Koideb609b3b2014-02-14 18:25:52 -080024 }
25
Toshio Koidea10c0372014-02-20 17:28:10 -080026 public Operator operator;
27 public Intent intent;
28
29 protected IntentOperation() {}
Toshio Koideb609b3b2014-02-14 18:25:52 -080030
31 public IntentOperation(Operator operator, Intent intent) {
32 this.operator = operator;
33 this.intent = intent;
34 }
35
Toshio Koide0c9106d2014-02-19 15:26:38 -080036 @Override
37 public String toString() {
38 return operator.toString() + ", (" + intent.toString() + ")";
39 }
Toshio Koideb609b3b2014-02-14 18:25:52 -080040}