Package org.instancio.settings
Interface SettingKey<T>
- Type Parameters:
T
- type of the value
public interface SettingKey<T>
A setting key represents a configuration item that can be
stored in a
Settings
instance.- Since:
- 1.0.1
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A builder for creating custom keys. -
Method Summary
-
Method Details
-
type
The type of value associated with this key.This method is used for converting a value from a string to the specified
type()
when retrieving the value fromSettings
.- Returns:
- the type of value associated with this key
- Since:
- 1.0.1
-
propertyKey
String propertyKey()A unique property key identifying this setting. The property key is used to identify the setting in a properties file.- Returns:
- a unique property key identifying this setting
- Since:
- 1.2.0
-
defaultValue
Default value for this key.- Returns:
- default value, or
null
if not defined - Since:
- 1.0.1
-
allowsNullValue
default boolean allowsNullValue()Indicates whether the value for this key can be set tonull
. Setting anull
for a key that does not acceptnull
will produce an exception.- Returns:
true
ifnull
is allowed,false
otherwise- Since:
- 1.5.1
-