blob: a31cbde870ba5320715a68c4ca9eee8f677b9796 [file] [log] [blame]
Toshio Koidead17d5e2014-02-11 11:36:02 -08001package net.onrc.onos.intent;
2
3/**
4 * @author Toshio Koide (t-koide@onlab.us)
5 */
6public abstract class Intent {
Toshio Koide0e4d8d22014-02-14 10:56:10 -08007 enum IntentState {
8 // TODO;
9 }
Toshio Koide13986d12014-02-11 20:25:32 -080010 protected String id;
Toshio Koide0e4d8d22014-02-14 10:56:10 -080011 protected IntentState state;
12
13 /**
14 * Default constructor for Kryo deserialization
15 */
Toshio Koidec406e792014-02-14 16:52:42 -080016 protected Intent() {
Toshio Koide0e4d8d22014-02-14 10:56:10 -080017 }
Toshio Koide13986d12014-02-11 20:25:32 -080018
19 public Intent(String id) {
20 this.id = id;
21 }
22
23 public String getId() {
24 return id;
25 }
Toshio Koideebdbb622014-02-12 20:28:38 -080026
Toshio Koide0e4d8d22014-02-14 10:56:10 -080027 public IntentState getState() {
28 return state;
29 }
30
31 public IntentState setState(IntentState newState) {
32 IntentState oldState = state;
33 state = newState;
34 return oldState;
35 }
Toshio Koide13986d12014-02-11 20:25:32 -080036
37 @Override
38 public int hashCode() {
39 return id.hashCode();
40 }
Toshio Koidead17d5e2014-02-11 11:36:02 -080041}