Interface ExpiringValue<T>

  • Type Parameters:
    T - The type of value.
    All Known Implementing Classes:
    BasicExpiringValue

    public interface ExpiringValue<T>
    A generic value with a limited validity period.
    • Method Detail

      • getValue

        T getValue()
        Gets the value.
        Returns:
        The value.
      • isExpired

        boolean isExpired()
        Checks if the value has already expired.
        Returns:
        true if the value has expired based on the current system time, false otherwise.
      • isExpired

        boolean isExpired​(Instant refInstant)
        Checks if the value has already expired.
        Parameters:
        refInstant - The reference point in time to check expiration against.
        Returns:
        true if the value has expired based on the given instant, false otherwise.
        Throws:
        NullPointerException - if the instant is null.