public interface Options extends Cloneable, Iterable<Map.Entry<Option<?>,Object>>
Option
instances. Implementation of this must be thread-safe.Modifier and Type | Method and Description |
---|---|
boolean |
contains(Option<?> option)
Checks if the provided
Option key exists in this container |
default <X> X |
get(Option<?> option,
Class<? extends Options> context) |
<X> X |
get(Option<X> option)
Retrieve
Option value from this container |
<X> X |
get(Option<X> option,
X defaultValue)
Retrieve option value from this container.
|
<X> X |
get(String key,
Class<? extends Options> context) |
<X> X |
getOrDefault(Option<X> option)
Retrieve the option value.
|
default <X> X |
getOrDefault(Option<X> option,
Class<? extends Options> context) |
default <X> X |
getOrDefault(String key,
Class<? extends Options> context) |
default boolean |
isEmpty()
Check if container is empty.
|
boolean |
isLocked(Option<?> option)
Check locked status of option
|
<X> void |
put(Option<X> option,
X value)
Add option value to this container
|
<X> void |
put(Option<X> option,
X value,
boolean locked)
Add option value to this container with the additional option to lockout the value
|
<X> X |
putIfAbsent(Option<X> option,
X value)
Add option value to this container if not yet existing
|
<X> void |
remove(Option<X> option)
Remove
Option value from this container. |
int |
size()
Returns the number of configuration
Option present for this container |
forEach, iterator, spliterator
<X> void put(Option<X> option, X value)
Add option value to this container
<X> X putIfAbsent(Option<X> option, X value)
Add option value to this container if not yet existing
<X> void put(Option<X> option, X value, boolean locked)
Add option value to this container with the additional option to lockout the value
X
- The captured type of the Option
option
- The Option
key to be used as lookupvalue
- The value to be addedlocked
- Set to true
if we should lockout this value. Future invocations of put(Option, Object)
will result in failure for this configuration Option
boolean isLocked(Option<?> option)
Check locked status of option
boolean contains(Option<?> option)
Checks if the provided Option
key exists in this container
<X> X get(Option<X> option, X defaultValue)
Retrieve option value from this container. If missing, the provided default value will be returned
<X> X getOrDefault(Option<X> option)
Retrieve the option value. If missing, the default value defined by the Option will be returned instead
default boolean isEmpty()
true
if the instance is empty.Copyright © 2016–2024. All rights reserved.