blob: 93a9f88631f80c064ad7a8fe8aa9e3e3b6e35be8 [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
26 public IntentOperation() {}
27
28 public IntentOperation(Operator operator, Intent intent) {
29 this.operator = operator;
30 this.intent = intent;
31 }
32
33 public Operator operator;
34 public Intent intent;
Toshio Koided9fa2a82014-02-19 17:35:18 -080035
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}