com.github.kaiwinter.androidremotenotifications.persistence.NotificationStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of android-remote-notifications Show documentation
Show all versions of android-remote-notifications Show documentation
Pulls notifications from a remote JSON file and shows them in your app.
package com.github.kaiwinter.androidremotenotifications.persistence;
import com.github.kaiwinter.androidremotenotifications.model.impl.PersistentNotification;
import java.util.Date;
import java.util.Set;
/**
* Interface for persisting notifications and configurations.
*/
public interface NotificationStore {
/**
* Loads the date when the notifications was updated from the server the last time.
*
* @return The last update date.
*/
Date getLastServerUpdate();
/**
* Saves the date when the notifications was updated from the server the last time.
*
* @param date The last update date.
*/
void saveLastServerUpdate(Date date);
/**
* Loads all saved {@link PersistentNotification}s.
*
* @return The saved {@link PersistentNotification}s
*/
Set getPersistentNotifications();
/**
* Updates the {@link PersistentNotification} in the {@link NotificationStore} with the given
* updatePersistentNotifications
. The notifications to update are identified by their hashCode/equals
* methods.
*
* @param updatePersistentNotifications The {@link PersistentNotification} to update.
*/
void updatePersistentNotification(Set updatePersistentNotifications);
/**
* Replaces the currently stored {@link PersistentNotification}s by the passed ones.
*
* @param persistentNotifications The {@link PersistentNotification}s to store.
*/
void replacePersistentNotifications(Set persistentNotifications);
/**
* Removes all notifications from the store.
*/
void clearPersistentNotifications();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy