net.named_data.jndn.security
public class ValidityPeriod extends Object implements ChangeCountable
| Constructor and Description |
|---|
ValidityPeriod()
Create a default ValidityPeriod where the period is not specified.
|
ValidityPeriod(ValidityPeriod validityPeriod)
Create a new ValidityPeriod with a copy of the fields in the given
validityPeriod.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Reset to a default ValidityPeriod where the period is not specified.
|
boolean |
equals(Object other) |
boolean |
equals(ValidityPeriod other)
Check if this is the same validity period as other.
|
long |
getChangeCount()
Get the change count, which is incremented each time this object is changed.
|
double |
getNotAfter()
Get the end of the validity period range.
|
double |
getNotBefore()
Get the beginning of the validity period range.
|
boolean |
hasPeriod()
Check if the period has been set.
|
boolean |
isValid(double time)
Check if the time falls within the validity period.
|
ValidityPeriod |
setPeriod(double notBefore,
double notAfter)
Set the validity period.
|
public ValidityPeriod()
public ValidityPeriod(ValidityPeriod validityPeriod)
validityPeriod - The ValidityPeriod to copy.public final boolean hasPeriod()
public final double getNotBefore()
public final double getNotAfter()
public final void clear()
public final ValidityPeriod setPeriod(double notBefore, double notAfter)
notBefore - The beginning of the validity period range as milliseconds
since Jan 1, 1970 UTC. Note that this is rounded up to the nearest whole
second.notAfter - The end of the validity period range as milliseconds
since Jan 1, 1970 UTC. Note that this is rounded down to the nearest whole
second.public final boolean equals(ValidityPeriod other)
other - The other ValidityPeriod to compare with.public final boolean isValid(double time)
time - The time to check as milliseconds since Jan 1, 1970 UTC.public final long getChangeCount()
getChangeCount in interface ChangeCountableCopyright © 2017. All rights reserved.