Package org.instancio.settings
Class Key
- java.lang.Object
-
- org.instancio.settings.Key
-
- All Implemented Interfaces:
Comparable<SettingKey>
,SettingKey
public final class Key extends Object implements SettingKey
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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
compareTo(SettingKey o)
<T> T
defaultValue()
Default value for this key.boolean
equals(Object o)
int
hashCode()
String
propertyKey()
A property key used in the properties file.String
toString()
<T> Class<T>
type()
Type of the property value.
-
-
-
Method Detail
-
propertyKey
public String propertyKey()
Description copied from interface:SettingKey
A property key used in the properties file.- Specified by:
propertyKey
in interfaceSettingKey
- Returns:
- property key
-
type
public <T> Class<T> 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
-
autoAdjust
public <T extends Number & Comparable<T>> void autoAdjust(Settings settings, T otherValue)
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
-
compareTo
public int compareTo(SettingKey o)
- Specified by:
compareTo
in interfaceComparable<SettingKey>
-
-