Package org.incendo.cloud.key
Interface CloudKeyContainer
- All Known Subinterfaces:
AggregateParsingContext<C>,MutableCloudKeyContainer
- All Known Implementing Classes:
CommandContext,CommandMeta,SimpleCommandMeta,SimpleMutableCloudKeyContainer
-
Method Summary
Modifier and TypeMethodDescriptionall()Returns all stored values.default booleanReturns whether the registry contains a value associated with the givenkey.booleanReturns whether the registry contains a value associated with the givenkey.default booleancontains(@NonNull CloudKeyHolder<?> keyHolder) Returns whether the registry contains a value associated with the givenkeyHolder.Returns the value associated with the givenkeyor fails exceptionally if it's missing.Returns the value associated with the givenkeyor fails exceptionally if it's missing.get(@NonNull CloudKeyHolder<V> keyHolder) Returns the value associated with the givenkeyHolderor fails exceptionally if it's missing.default <V> VgetOrDefault(@NonNull String key, V defaultValue) Returns the value associated with the givenkeyif it exists, or else thedefaultValue.default <V> VgetOrDefault(@NonNull CloudKey<@NonNull V> key, V defaultValue) Returns the value associated with the givenkeyif it exists, or else thedefaultValue.default <V> VgetOrDefault(@NonNull CloudKeyHolder<@NonNull V> keyHolder, V defaultValue) Returns the value associated with the givenkeyHolderif it exists, or else thedefaultValue.default <V> VgetOrSupplyDefault(@NonNull String key, @NonNull Supplier<V> supplier) Returns the value associated with the givenkeyif it exists, or else the value supplied by the givensupplierdefault <V> VReturns the value associated with the givenkeyif it exists, or else the value supplied by the givensupplierdefault <V> VgetOrSupplyDefault(@NonNull CloudKeyHolder<@NonNull V> keyHolder, @NonNull Supplier<V> supplier) Returns the value associated with the givenkeyHolderif it exists, or else the value supplied by the givensupplierReturns the value associated with the givenkey.Returns the value associated with the givenkey.optional(@NonNull CloudKeyHolder<V> keyHolder) Returns the value associated with the givenkeyHolder.
-
Method Details
-
optional
Returns the value associated with the givenkey.- Type Parameters:
V- the type of the value- Parameters:
key- the key- Returns:
- the value
-
optional
Returns the value associated with the givenkey.- Type Parameters:
V- the type of the value- Parameters:
key- the key- Returns:
- the value
-
optional
default <V extends @NonNull Object> @NonNull Optional<V> optional(@NonNull CloudKeyHolder<V> keyHolder) Returns the value associated with the givenkeyHolder.- Type Parameters:
V- the type of the value- Parameters:
keyHolder- the holder of the key- Returns:
- the value
-
getOrDefault
Returns the value associated with the givenkeyif it exists, or else thedefaultValue.- Type Parameters:
V- the type of the value- Parameters:
key- the keydefaultValue- the default value to use if the value isn't present- Returns:
- the value
-
getOrDefault
Returns the value associated with the givenkeyif it exists, or else thedefaultValue.- Type Parameters:
V- the type of the value- Parameters:
key- the keydefaultValue- the default value to use if the value isn't present- Returns:
- the value
-
getOrDefault
Returns the value associated with the givenkeyHolderif it exists, or else thedefaultValue.- Type Parameters:
V- the type of the value- Parameters:
keyHolder- the holder of the keydefaultValue- the default value to use if the value isn't present- Returns:
- the value
-
getOrSupplyDefault
Returns the value associated with the givenkeyif it exists, or else the value supplied by the givensupplier- Type Parameters:
V- the type of the value- Parameters:
key- the keysupplier- supplier of the default value- Returns:
- the value
-
getOrSupplyDefault
Returns the value associated with the givenkeyif it exists, or else the value supplied by the givensupplier- Type Parameters:
V- the type of the value- Parameters:
key- the keysupplier- supplier of the default value- Returns:
- the value
-
getOrSupplyDefault
default <V> V getOrSupplyDefault(@NonNull CloudKeyHolder<@NonNull V> keyHolder, @NonNull Supplier<V> supplier) Returns the value associated with the givenkeyHolderif it exists, or else the value supplied by the givensupplier- Type Parameters:
V- the type of the value- Parameters:
keyHolder- the holder of the keysupplier- supplier of the default value- Returns:
- the value
-
get
Returns the value associated with the givenkeyor fails exceptionally if it's missing.- Type Parameters:
V- the type of the value- Parameters:
key- the key- Returns:
- the value
- Throws:
NullPointerException- if the value is missing
-
get
Returns the value associated with the givenkeyor fails exceptionally if it's missing.- Type Parameters:
V- the type of the value- Parameters:
key- the key- Returns:
- the value
- Throws:
NullPointerException- if the value is missing
-
get
Returns the value associated with the givenkeyHolderor fails exceptionally if it's missing.- Type Parameters:
V- the type of the value- Parameters:
keyHolder- the holder of the key- Returns:
- the value
- Throws:
NullPointerException- if the value is missing
-
contains
Returns whether the registry contains a value associated with the givenkey.- Parameters:
key- the key- Returns:
trueif the value exists, orfalseif it does not
-
contains
Returns whether the registry contains a value associated with the givenkey.- Parameters:
key- the key- Returns:
trueif the value exists, orfalseif it does not
-
contains
Returns whether the registry contains a value associated with the givenkeyHolder.- Parameters:
keyHolder- the holder of the key- Returns:
trueif the value exists, orfalseif it does not
-
all
Returns all stored values.- Returns:
- immutable view of all values
-