Package cc.carm.lib.easyoptions
Interface OptionHolder
-
public interface OptionHolder
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <V> V
clear(@NotNull OptionType<V> type)
Set the value of option to option'sOptionType.defaults()
.static OptionHolder
createOptionHolder()
static OptionHolder
createOptionHolder(@NotNull java.util.Map<OptionType<?>,java.lang.Object> options)
default <V> V
get(@NotNull OptionType<V> type)
Get the value of option.@NotNull java.util.Map<OptionType<?>,java.lang.Object>
options()
default <V> V
set(@NotNull OptionType<V> type, V value)
Set the value of option.
-
-
-
Method Detail
-
createOptionHolder
static OptionHolder createOptionHolder()
-
createOptionHolder
static OptionHolder createOptionHolder(@NotNull @NotNull java.util.Map<OptionType<?>,java.lang.Object> options)
-
options
@NotNull @NotNull java.util.Map<OptionType<?>,java.lang.Object> options()
-
get
@NotNull default <V> V get(@NotNull @NotNull OptionType<V> type)
Get the value of option.- Type Parameters:
V
- Value type- Parameters:
type
-OptionType
- Returns:
- Value of option
-
set
@Nullable default <V> V set(@NotNull @NotNull OptionType<V> type, @Nullable V value)
Set the value of option.- Type Parameters:
V
- Value type- Parameters:
type
-OptionType
value
- Value of option- Returns:
- Previous value of option
-
clear
@Nullable default <V> V clear(@NotNull @NotNull OptionType<V> type)
Set the value of option to option'sOptionType.defaults()
.- Type Parameters:
V
- Value type- Parameters:
type
-OptionType
- Returns:
- Previous value of option
-
-