sdmxdl.HasExpiration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdmx-dl-api Show documentation
Show all versions of sdmx-dl-api Show documentation
Easily download official statistics - API
package sdmxdl;
import lombok.NonNull;
import java.time.Clock;
import java.time.Instant;
/**
* Defines the ability to expire.
*/
public interface HasExpiration {
@NonNull Instant getExpirationTime();
default boolean isExpired(@NonNull Clock clock) {
return !clock.instant().isBefore(getExpirationTime());
}
}