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

sdmxdl.HasExpiration Maven / Gradle / Ivy

There is a newer version: 3.0.0-beta.13
Show newest version
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());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy