Package org.instancio.internal.settings
Class RangeAdjuster.ForMax
java.lang.Object
org.instancio.internal.settings.RangeAdjuster.ForMax
- All Implemented Interfaces:
RangeAdjuster
- Enclosing interface:
RangeAdjuster
Adjusts the upper bound of a range given a new lower bound.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.instancio.internal.settings.RangeAdjuster
RangeAdjuster.ForMax, RangeAdjuster.ForMin
-
Field Summary
Fields inherited from interface org.instancio.internal.settings.RangeAdjuster
MAX_ADJUSTER, MIN_ADJUSTER
-
Method Summary
Modifier and TypeMethodDescription<T extends Number & Comparable<T>>
voidadjustRange
(Settings settings, SettingKey<T> maxSetting, T newMin) Adjust givenkey
based onotherValue
.
-
Method Details
-
adjustRange
public <T extends Number & Comparable<T>> void adjustRange(Settings settings, SettingKey<T> maxSetting, T newMin) Description copied from interface:RangeAdjuster
Adjust givenkey
based onotherValue
.For example, if min is set to a value higher than the max, will auto-adjust max by a specified amount (and vice versa).
- Specified by:
adjustRange
in interfaceRangeAdjuster
- Type Parameters:
T
- numeric type- Parameters:
settings
- to updatemaxSetting
- to updatenewMin
- based on which to update given setting key
-