All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.kaiwinter.androidremotenotifications.persistence.NotificationStore Maven / Gradle / Ivy

There is a newer version: 1.1.5
Show newest version
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