Package org.instancio.settings
Class Key
java.lang.Object
org.instancio.settings.Key
- All Implemented Interfaces:
Comparable<SettingKey>
,SettingKey
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether the value for this key can be set tonull
.<T extends Number & Comparable<T>>
voidautoAdjust
(Settings settings, T otherValue) Auto-adjusts theSettings
value for this key based on the value of another setting key.int
<T> T
Default value for this key.boolean
int
hashCode()
A property key that can be used to configure this setting in a properties file.toString()
<T> Class<T>
type()
Type of the property value.
-
Method Details
-
propertyKey
Description copied from interface:SettingKey
A property key that can be used to configure this setting in a properties file.- Specified by:
propertyKey
in interfaceSettingKey
- Returns:
- property key
-
type
Description copied from interface:SettingKey
Type of the property value.- Specified by:
type
in interfaceSettingKey
- Returns:
- value class
-
defaultValue
public <T> T defaultValue()Description copied from interface:SettingKey
Default value for this key.- Specified by:
defaultValue
in interfaceSettingKey
- Type Parameters:
T
- type of the value- Returns:
- default value
-
allowsNullValue
public boolean allowsNullValue()Description copied from interface:SettingKey
Indicates whether the value for this key can be set tonull
.- Specified by:
allowsNullValue
in interfaceSettingKey
- Returns:
true
ifnull
is allowed,false
otherwise
-
autoAdjust
Description copied from interface:SettingKey
Auto-adjusts theSettings
value for this key based on the value of another setting key.- Specified by:
autoAdjust
in interfaceSettingKey
- Parameters:
settings
- to adjustotherValue
- value of the other setting to base the adjustment off
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<SettingKey>
-
toString
-