Package org.instancio.internal.settings
Class InternalKey
java.lang.Object
org.instancio.internal.settings.InternalKey
- All Implemented Interfaces:
Comparable<SettingKey>
,SettingKey
-
Constructor Summary
ConstructorDescriptionInternalKey
(String propertyKey, Class<?> type, @Nullable Object defaultValue, @Nullable RangeAdjuster rangeAdjuster, boolean allowsNullValue) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether the value for this key can be set tonull
.<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.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.
-
Constructor Details
-
InternalKey
public InternalKey(String propertyKey, Class<?> type, @Nullable @Nullable Object defaultValue, @Nullable @Nullable RangeAdjuster rangeAdjuster, boolean allowsNullValue)
-
-
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
public <T extends Number & Comparable<T>> void autoAdjust(@NotNull @NotNull Settings settings, @NotNull 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
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<SettingKey>
-
toString
-