public final class PersistentNotification
extends java.lang.Object
PersistentNotification
is a UserNotification
which can be stored in the shared preferences. It stores
metadata about the UserNotification
such as last shown date etc.Constructor and Description |
---|
PersistentNotification(UserNotification notification) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.Date |
getLastShown()
Returns the time when the notification was shown the last time.
|
UserNotification |
getNotification()
Returns the notification to show.
|
int |
getShownCounter()
Returns the number of times the notification was shown already.
|
int |
hashCode() |
boolean |
hasToBeShown(int appVersionCode)
Checks whether the
UserNotification has to be shown considering the NotificationConfiguration . |
void |
setLastShown(java.util.Date lastShown)
Sets the time when the notification was shown the last time.
|
void |
setShownCounter(int shownCounter)
Sets the number of times the notification was shown already.
|
java.lang.String |
toString() |
public PersistentNotification(UserNotification notification)
notification
- The AlertDialogNotification
to persist, not null
.public boolean hasToBeShown(int appVersionCode)
UserNotification
has to be shown considering the NotificationConfiguration
.appVersionCode
- the app“s versionCodepublic java.util.Date getLastShown()
public void setLastShown(java.util.Date lastShown)
lastShown
- the time when the notification was shown the last timepublic int getShownCounter()
public void setShownCounter(int shownCounter)
shownCounter
- the number of times the notification was shown already.public UserNotification getNotification()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object