Package org.instancio.settings
Interface SettingKey
- All Superinterfaces:
Comparable<SettingKey>
- All Known Implementing Classes:
InternalKey
A setting key represents a configuration item and has the following properties:
propertyKey()
- property name that can be used in a configuration filedefaultValue()
- that will be used if there is no configuration file present
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether the value for this key can be set tonull
.default <T extends Number & Comparable<T>>
voidautoAdjust
(@NotNull Settings settings, T otherValue) Auto-adjusts theSettings
value for this key based on the value of another setting key.<T> T
Default value for this key.A property key that can be used to configure this setting in a properties file.<T> Class<T>
type()
Type of the property value.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
propertyKey
String propertyKey()A property key that can be used to configure this setting in a properties file.- Returns:
- property key
- Since:
- 1.2.0
-
type
Type of the property value.- Returns:
- value class
- Since:
- 1.0.1
-
defaultValue
<T> T defaultValue()Default value for this key.- Type Parameters:
T
- type of the value- Returns:
- default value
- Since:
- 1.0.1
-
allowsNullValue
boolean allowsNullValue()Indicates whether the value for this key can be set tonull
.- Returns:
true
ifnull
is allowed,false
otherwise- Since:
- 1.5.1
-
autoAdjust
default <T extends Number & Comparable<T>> void autoAdjust(@NotNull @NotNull Settings settings, @NotNull T otherValue) Auto-adjusts theSettings
value for this key based on the value of another setting key.- Parameters:
settings
- to adjustotherValue
- value of the other setting to base the adjustment off- Since:
- 1.2.0
-