public final class VersionCodePolicy
extends java.lang.Object
VersionCodePolicy
the notification will not be shown.
There are three ways to define on which versions of your app the notification should be shown: onAllBefore,
onAllAfter and onSpecific. You can also mix them but have to keep them sane. Only one of the previous named
parameters have to match to let the notification show. They are evaluated in the previous named order.Constructor and Description |
---|
VersionCodePolicy() |
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
getOnAllAfter() |
java.lang.Integer |
getOnAllBefore() |
java.util.Collection<java.lang.Integer> |
getOnSpecific() |
boolean |
hasBeShownForThisVersion(int appVersionCode)
Checks if one of
onAllAfter , onAllBefore or onSpecific matches the given
versionCode . |
void |
setOnAllAfter(java.lang.Integer onAllAfter)
Set the versionCode after which the notification should be shown.
|
void |
setOnAllBefore(java.lang.Integer onAllBefore)
Sets the versionCode before which the notification should be shown.
|
void |
setOnSpecific(java.util.Collection<java.lang.Integer> onSpecific)
Sets specific app versionCodes on which the notification should be shown.
|
public boolean hasBeShownForThisVersion(int appVersionCode)
onAllAfter
, onAllBefore
or onSpecific
matches the given
versionCode
. If one matches true
is returned, else false
.appVersionCode
- The version code to match against this VersionCodePolicy
.true
if the notification should be shown, else false
.public java.lang.Integer getOnAllBefore()
public void setOnAllBefore(java.lang.Integer onAllBefore)
onAllBefore
- the versionCode before which the notification should be shownpublic java.lang.Integer getOnAllAfter()
public void setOnAllAfter(java.lang.Integer onAllAfter)
onAllAfter
- the versionCode after which the notification should be shownpublic java.util.Collection<java.lang.Integer> getOnSpecific()
public void setOnSpecific(java.util.Collection<java.lang.Integer> onSpecific)
onSpecific
- the app versionCodes on which the notification should be shown