@Override public List<String> getCachedPersonIdsToPrayFor() { LocalCacheDataPOJO cacheData = getCacheData(); if (cacheData != null && cacheData.getPersonIdsToPrayFor() != null && !cacheData.getPersonIdsToPrayFor().isEmpty()) { return cacheData.getPersonIdsToPrayFor(); } return null; }
private void populateCacheData(LocalCacheData realmCacheData, LocalCacheDataPOJO newCacheData) { realmCacheData.setCreationDate(generateCreationDate()); if (newCacheData.getPersonIdsToPrayFor() != null) { List<String> personIdsToPrayFor = newCacheData.getPersonIdsToPrayFor(); RealmList<RealmString> managedPersonIdsToPrayFor = new RealmList<>(); for (String personIdToPrayFor : personIdsToPrayFor) { managedPersonIdsToPrayFor.add(realm.copyToRealm(new RealmString(personIdToPrayFor))); } realmCacheData.setPersonIdsToPrayFor(managedPersonIdsToPrayFor); } if (newCacheData.getScriptureCitation() != null) realmCacheData.setScriptureCitation(newCacheData.getScriptureCitation()); if (newCacheData.getScriptureText() != null) realmCacheData.setScriptureText(newCacheData.getScriptureText()); if (newCacheData.getScriptureJson() != null) realmCacheData.setScriptureJson(newCacheData.getScriptureJson()); if (newCacheData.getVerseImageURL() != null) realmCacheData.setVerseImageURL(newCacheData.getVerseImageURL()); }