com.venky.swf.plugins.templates.db.model.alerts.DeviceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swf-plugin-templates Show documentation
Show all versions of swf-plugin-templates Show documentation
Succinct Web Framework - Templates
The newest version!
package com.venky.swf.plugins.templates.db.model.alerts;
import com.venky.swf.db.table.ModelImpl;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
public class DeviceImpl extends ModelImpl {
public DeviceImpl(){
super();
}
public DeviceImpl(Device device){
super(device);
}
public JSONObject getSubscriptionJson(){
JSONObject jsonObject = new JSONObject();
Device device = getProxy();
boolean isDeviceIdJSON = (device.getDeviceId().startsWith("{"));
if (!isDeviceIdJSON){
jsonObject.put("client","android");
jsonObject.put("token",device.getDeviceId());
}else {
jsonObject = (JSONObject) JSONValue.parse(device.getDeviceId());
}
return jsonObject;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy