@Test public void toJSONTest() { TriggerWifiSsid t = new TriggerWifiSsid().setValue("aSSID").comparator(Comparator.Compare.IS_EQUAL); Assert.assertEquals(json, t.toJSON()); }
@Override public synchronized String toJSON() { JSONObject o = new JSONObject(); try { o.put("type", TriggerWifiSsid.class.getName()); JSONObject data = new JSONObject(); data.put("ssid", getValue()); data.put("lastRun", lastRun); data.put("comparator", comparator.getValue().toString()); o.put("data", data); } catch (JSONException e) { log.error("Unhandled exception", e); } return o.toString(); }
TriggerWifiSsid extends Trigger { @Override public synchronized String toJSON() { JSONObject o = new JSONObject(); try { o.put("type", TriggerWifiSsid.class.getName()); JSONObject data = new JSONObject(); data.put("ssid", getValue()); data.put("lastRun", lastRun); data.put("comparator", comparator.getValue().toString()); o.put("data", data); } catch (JSONException e) { log.error("Unhandled exception", e); } return o.toString(); } }
TriggerWifiSsid extends Trigger { @Override public synchronized String toJSON() { JSONObject o = new JSONObject(); try { o.put("type", TriggerWifiSsid.class.getName()); JSONObject data = new JSONObject(); data.put("ssid", getValue()); data.put("lastRun", lastRun); data.put("comparator", comparator.getValue().toString()); o.put("data", data); } catch (JSONException e) { log.error("Unhandled exception", e); } return o.toString(); } TriggerWifiSsid(); private  TriggerWifiSsid(TriggerWifiSsid triggerWifiSsid); }
TriggerWifiSsid extends Trigger { @Override public synchronized String toJSON() { JSONObject o = new JSONObject(); try { o.put("type", TriggerWifiSsid.class.getName()); JSONObject data = new JSONObject(); data.put("ssid", getValue()); data.put("lastRun", lastRun); data.put("comparator", comparator.getValue().toString()); o.put("data", data); } catch (JSONException e) { log.error("Unhandled exception", e); } return o.toString(); } TriggerWifiSsid(); private  TriggerWifiSsid(TriggerWifiSsid triggerWifiSsid); String getValue(); Comparator getComparator(); @Override synchronized boolean shouldRun(); @Override synchronized String toJSON(); @Override int friendlyName(); @Override String friendlyDescription(); @Override Optional<Integer> icon(); @Override Trigger duplicate(); @Override void generateDialog(LinearLayout root, FragmentManager fragmentManager); }
TriggerWifiSsid extends Trigger { @Override public synchronized String toJSON() { JSONObject o = new JSONObject(); try { o.put("type", TriggerWifiSsid.class.getName()); JSONObject data = new JSONObject(); data.put("ssid", getValue()); data.put("lastRun", lastRun); data.put("comparator", comparator.getValue().toString()); o.put("data", data); } catch (JSONException e) { log.error("Unhandled exception", e); } return o.toString(); } TriggerWifiSsid(); private  TriggerWifiSsid(TriggerWifiSsid triggerWifiSsid); String getValue(); Comparator getComparator(); @Override synchronized boolean shouldRun(); @Override synchronized String toJSON(); @Override int friendlyName(); @Override String friendlyDescription(); @Override Optional<Integer> icon(); @Override Trigger duplicate(); @Override void generateDialog(LinearLayout root, FragmentManager fragmentManager);  }