Package org.instancio.internal.settings
Interface RangeAdjuster
- All Known Implementing Classes:
RangeAdjuster.ForMax
,RangeAdjuster.ForMin
Provides support for auto-adjusting 'range' settings that have a min and a max value.
- Since:
- 1.1.10
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Adjusts the upper bound of a range given a new lower bound.static class
Adjusts the lower bound of a range given a new upper bound. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends Number & Comparable<T>>
voidadjustRange
(Settings settings, SettingKey key, T otherValue) Adjust givenkey
based onotherValue
.
-
Field Details
-
MIN_ADJUSTER
-
MAX_ADJUSTER
-
-
Method Details
-
adjustRange
<T extends Number & Comparable<T>> void adjustRange(Settings settings, SettingKey key, T otherValue) 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).
- Type Parameters:
T
- numeric type- Parameters:
settings
- to updatekey
- to updateotherValue
- based on which to update given setting key
-