33605e96918a67385938e57b4e54ea5341a7b221
[iotcloud.git] / src / serverJ / src / main / java / com / iotcloud / iot / slots / Slot.java
1 package com.iotcloud.iot.slots;
2
3 /**
4  * Created by joel on 7/22/16.
5  */
6
7 import org.json.JSONException;
8 import org.json.JSONObject;
9 public class Slot {
10
11
12     //int is not a good choice for sequenceNumber I believe;
13
14     int sequenceNumber;
15     String slotValue;
16
17     public Slot(int sequenceNumber, String slotValue) {
18         this.sequenceNumber = sequenceNumber;
19         this.slotValue = slotValue;
20     }
21
22     public String toJsonString() throws JSONException {
23         JSONObject obj = new JSONObject();
24         obj.put(Integer.toString(this.sequenceNumber),this.slotValue);
25         return obj.toString();
26     }
27
28 }