Enum CachedSupplier.StaleValueBehavior

java.lang.Object
java.lang.Enum<CachedSupplier.StaleValueBehavior>
software.amazon.awssdk.utils.cache.CachedSupplier.StaleValueBehavior
All Implemented Interfaces:
Serializable, Comparable<CachedSupplier.StaleValueBehavior>
Enclosing class:
CachedSupplier<T>

public static enum CachedSupplier.StaleValueBehavior extends Enum<CachedSupplier.StaleValueBehavior>
How the cached supplier should behave when a stale value is retrieved from the underlying supplier or the underlying supplier fails while the cached value is stale.
  • Enum Constant Details

    • STRICT

      public static final CachedSupplier.StaleValueBehavior STRICT
      Strictly treat the stale time. Never return a stale cached value (except when the supplier returns an expired value, in which case the supplier will return the value but only for a very short period of time to prevent overloading the underlying supplier).
    • ALLOW

      public static final CachedSupplier.StaleValueBehavior ALLOW
      Allow stale values to be returned from the cache. Value retrieval will never fail, as long as the cache has succeeded when calling the underlying supplier at least once.
  • Method Details

    • values

      public static CachedSupplier.StaleValueBehavior[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static CachedSupplier.StaleValueBehavior valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null