2018-01-07 20:24:42 +01:00
|
|
|
package info.nightscout.androidaps.events;
|
|
|
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event which is published with data fetched from NightScout specific for the
|
|
|
|
* Food-class.
|
|
|
|
*
|
|
|
|
* Payload is the from NS retrieved JSON-String which should be handled by all
|
|
|
|
* subscriber.
|
|
|
|
*/
|
|
|
|
|
2018-01-29 21:57:50 +01:00
|
|
|
public class EventNsFood extends Event {
|
2018-01-07 20:24:42 +01:00
|
|
|
|
|
|
|
public static final int ADD = 0;
|
|
|
|
public static final int UPDATE = 1;
|
|
|
|
public static final int REMOVE = 2;
|
|
|
|
|
|
|
|
private final int mode;
|
|
|
|
|
|
|
|
private final Bundle payload;
|
|
|
|
|
2018-01-29 21:57:50 +01:00
|
|
|
public EventNsFood(int mode, Bundle payload) {
|
2018-01-07 20:24:42 +01:00
|
|
|
this.mode = mode;
|
|
|
|
this.payload = payload;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getMode() {
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Bundle getPayload() {
|
|
|
|
return payload;
|
|
|
|
}
|
|
|
|
}
|