Package org.instancio.internal.settings
Class InternalKey<T>
java.lang.Object
org.instancio.internal.settings.InternalKey<T>
- All Implemented Interfaces:
Comparable<SettingKey<T>>
,AutoAdjustable
,SettingKey<T>
public final class InternalKey<T>
extends Object
implements SettingKey<T>, AutoAdjustable, Comparable<SettingKey<T>>
-
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
.<N extends Number & Comparable<N>>
voidautoAdjust
(@NotNull Settings settings, N otherValue) Auto-adjusts theSettings
value for this key based on the value of another setting key.int
compareTo
(SettingKey<T> o) Default value for this key.boolean
int
hashCode()
A property key that can be used to configure this setting in a properties file.toString()
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<T>
- Returns:
- property key
-
type
Description copied from interface:SettingKey
Type of the property value.- Specified by:
type
in interfaceSettingKey<T>
- Returns:
- value class
-
defaultValue
Description copied from interface:SettingKey
Default value for this key.- Specified by:
defaultValue
in interfaceSettingKey<T>
- 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<T>
- Returns:
true
ifnull
is allowed,false
otherwise
-
autoAdjust
public <N extends Number & Comparable<N>> void autoAdjust(@NotNull @NotNull Settings settings, @NotNull N otherValue) Description copied from interface:AutoAdjustable
Auto-adjusts theSettings
value for this key based on the value of another setting key.- Specified by:
autoAdjust
in interfaceAutoAdjustable
- Type Parameters:
N
- a comparable number- 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<T>
-
toString
-