private JSONObject getMessageCenter() { try { if (!isNull(KEY_MESSAGE_CENTER)) { return getJSONObject(KEY_MESSAGE_CENTER); } } catch (JSONException e) { logException(e); } return null; }
@Override public int getListItemType() { if (isAutomatedMessage()) { return MESSAGE_AUTO; } else if (isOutgoingMessage()) { return MESSAGE_OUTGOING; } else { return MESSAGE_INCOMING; } }
public CommerceExtendedData(Object id, String affiliation, double revenue, double shipping, double tax, String currency) throws JSONException { setId(id); setAffiliation(affiliation); setRevenue(revenue); setShipping(shipping); setTax(tax); setCurrency(currency); }
public long getConfigurationCacheExpirationMillis() { try { if (!isNull(KEY_CONFIGURATION_CACHE_EXPIRATION_MILLIS)) { return getLong(KEY_CONFIGURATION_CACHE_EXPIRATION_MILLIS); } } catch (JSONException e) { logException(e); } return Constants.CONFIG_DEFAULT_APP_CONFIG_EXPIRATION_MILLIS; }
@SuppressWarnings("unchecked") // We check it coming in. public CustomData getCustomData() { if (!isNull(KEY_CUSTOM_DATA)) { try { return new CustomData(getJSONObject(KEY_CUSTOM_DATA)); } catch (JSONException e) { logException(e); } } return null; }
@SuppressWarnings("unchecked") // We check it coming in. public CustomData getCustomData() { if (!isNull(KEY_CUSTOM_DATA)) { try { return new CustomData(getJSONObject(KEY_CUSTOM_DATA)); } catch (JSONException e) { logException(e); } } return null; }
@Override protected void init() { setType(Type.time); setVersion(VERSION); }
@Override protected void init() { setType(Type.location); setVersion(VERSION); }
protected ApptentiveMessage(String json) throws JSONException { super(PayloadType.message, json); state = State.unknown; initType(); }
public TimeExtendedData(Date date) { super(); setTimestamp(date); }
@Override public String getHttpRequestContentType() { if (isAuthenticated()) { return "application/octet-stream"; } else { return "application/json"; } }
/** * This is made public primarily so that unit tests can be made to run successfully no matter what the time zone. */ public void setClientCreatedAtUtcOffset(int clientCreatedAtUtcOffset) { put(KEY_CLIENT_CREATED_AT_UTC_OFFSET, clientCreatedAtUtcOffset); } }
@Override protected void initType() { setType(Type.CompoundMessage); }
public void setMParticleId(String mParticleId) { put(KEY_M_PARTICLE_ID, mParticleId); } }
public void setDistributionVersion(String distributionVersion) { put(KEY_DISTRIBUTION_VERSION, distributionVersion); } }
protected ApptentiveMessage() { super(PayloadType.message); state = State.sending; read = true; // This message originated here. initType(); }
public TimeExtendedData(long millis) { super(); setTimestamp(millis); }