Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 1 | package net.onrc.onos.intent; |
| 2 | |
| 3 | /** |
| 4 | * @author Toshio Koide (t-koide@onlab.us) |
| 5 | */ |
| 6 | public abstract class Intent { |
Toshio Koide | 0e4d8d2 | 2014-02-14 10:56:10 -0800 | [diff] [blame] | 7 | enum IntentState { |
| 8 | // TODO; |
| 9 | } |
Toshio Koide | 13986d1 | 2014-02-11 20:25:32 -0800 | [diff] [blame] | 10 | protected String id; |
Toshio Koide | 0e4d8d2 | 2014-02-14 10:56:10 -0800 | [diff] [blame] | 11 | protected IntentState state; |
| 12 | |
| 13 | /** |
| 14 | * Default constructor for Kryo deserialization |
| 15 | */ |
Toshio Koide | c406e79 | 2014-02-14 16:52:42 -0800 | [diff] [blame] | 16 | protected Intent() { |
Toshio Koide | 0e4d8d2 | 2014-02-14 10:56:10 -0800 | [diff] [blame] | 17 | } |
Toshio Koide | 13986d1 | 2014-02-11 20:25:32 -0800 | [diff] [blame] | 18 | |
| 19 | public Intent(String id) { |
| 20 | this.id = id; |
| 21 | } |
| 22 | |
| 23 | public String getId() { |
| 24 | return id; |
| 25 | } |
Toshio Koide | ebdbb62 | 2014-02-12 20:28:38 -0800 | [diff] [blame] | 26 | |
Toshio Koide | 0e4d8d2 | 2014-02-14 10:56:10 -0800 | [diff] [blame] | 27 | 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 Koide | 13986d1 | 2014-02-11 20:25:32 -0800 | [diff] [blame] | 36 | |
| 37 | @Override |
| 38 | public int hashCode() { |
| 39 | return id.hashCode(); |
| 40 | } |
Toshio Koide | ad17d5e | 2014-02-11 11:36:02 -0800 | [diff] [blame] | 41 | } |