@Override protected boolean execute(Conversation conversation) { conversation.getDevice().getCustomData().put(key, version); return true; } }, "add custom device data");
public Person() { customData = new CustomData(); }
@Override protected boolean execute(Conversation conversation) { conversation.getDevice().getCustomData().remove(key); return true; } }, "remove custom device data");
data.getDevice().getCustomData().put("foo", "bar"); assertTrue(listenerFired); listenerFired = false; data.getDevice().getCustomData().remove("foo"); assertTrue(listenerFired); listenerFired = false; listenerFired = false; data.getDevice().getCustomData().put("foo", "bar"); assertTrue(listenerFired); listenerFired = false; listenerFired = false; data.getPerson().setCustomData(new CustomData()); assertTrue(listenerFired); listenerFired = false; data.getPerson().getCustomData().put("foo", "bar"); assertTrue(listenerFired); listenerFired = false; data.getPerson().getCustomData().remove("foo"); assertTrue(listenerFired); listenerFired = false;
CustomData customData = new CustomData(); Iterator it = customDataOld.keys(); while (it.hasNext()) { Object value = customDataOld.get(key); if (value instanceof JSONObject) { customData.put(key, jsonObjectToSerializableType((JSONObject) value)); } else { customData.put(key, (Serializable) value);
public com.apptentive.android.sdk.model.CustomData toJson() { try { com.apptentive.android.sdk.model.CustomData ret = new com.apptentive.android.sdk.model.CustomData(); Set<String> keys = keySet(); for (String key : keys) { ret.put(key, get(key)); } return ret; } catch (JSONException e) { ApptentiveLog.e(e, "Exception while creating custom data"); logException(e); } return null; } }
@Override public void setDataChangedListener(DataChangedListener listener) { this.listener = listener; customData.setDataChangedListener(this); }
@Override public Serializable put(String key, Serializable value) { Serializable ret = super.put(key, value); notifyDataChanged(); return ret; }
public Person clone() { Person person = new Person(); person.id = id; person.email = email; person.name = name; person.facebookId = facebookId; person.phoneNumber = phoneNumber; person.street = street; person.city = city; person.zip = zip; person.country = country; person.birthday = birthday; if (customData != null) { person.customData.putAll(customData); } person.listener = listener; return person; }
ret.setCustomData(customData != null ? customData.toJson() : null); changed = true;
CustomData customData = new CustomData(); Iterator it = customDataOld.keys(); while (it.hasNext()) { Object value = customDataOld.get(key); if (value instanceof JSONObject) { customData.put(key, jsonObjectToSerializableType((JSONObject) value)); } else { customData.put(key, (Serializable) value);
public void setCustomData(CustomData customData) { this.customData = customData; this.customData.setDataChangedListener(this); notifyDataChanged(); }
@Override public void clear() { super.clear(); notifyDataChanged(); } //endregion
clone.radioVersion = radioVersion; if (customData != null) { clone.customData.putAll(customData);
ret.setCustomData(customData != null ? customData.toJson() : null); changed = true;
@Override protected boolean execute(Conversation conversation) { conversation.getDevice().getCustomData().put(key, dateTime); return true; } }, "add custom device data");
@Override protected boolean execute(Conversation conversation) { conversation.getPerson().getCustomData().remove(key); return true; } }, "remove custom person data");
public Device() { customData = new CustomData(); integrationConfig = new IntegrationConfig(); }
@Override public void setDataChangedListener(DataChangedListener listener) { this.listener = listener; customData.setDataChangedListener(this); integrationConfig.setDataChangedListener(this); }