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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CachedSupplier.StaleValueBehavior
valueOf(String name)
Returns the enum constant of this type with the specified name.static CachedSupplier.StaleValueBehavior[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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 Detail
-
values
public static CachedSupplier.StaleValueBehavior[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CachedSupplier.StaleValueBehavior c : CachedSupplier.StaleValueBehavior.values()) System.out.println(c);
- 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 nameNullPointerException
- if the argument is null
-
-