blob: 921d430cc7ec6844450ed8184c54f2c87c96fc6f [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 */
16 @Deprecated
17 public Intent() {
18 }
Toshio Koide13986d12014-02-11 20:25:32 -080019
20 public Intent(String id) {
21 this.id = id;
22 }
23
24 public String getId() {
25 return id;
26 }
Toshio Koideebdbb622014-02-12 20:28:38 -080027
Toshio Koide0e4d8d22014-02-14 10:56:10 -080028 public IntentState getState() {
29 return state;
30 }
31
32 public IntentState setState(IntentState newState) {
33 IntentState oldState = state;
34 state = newState;
35 return oldState;
36 }
Toshio Koide13986d12014-02-11 20:25:32 -080037
38 @Override
39 public int hashCode() {
40 return id.hashCode();
41 }
Toshio Koidead17d5e2014-02-11 11:36:02 -080042}