Package org.instancio.settings
Interface RangeAdjuster
-
- All Known Implementing Classes:
RangeAdjuster.ForMax
,RangeAdjuster.ForMin
public interface RangeAdjuster
Provides support for auto-adjusting 'range' settings that have a min and a max value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RangeAdjuster.ForMax
Adjusts the upper bound of a range given a new lower bound.static class
RangeAdjuster.ForMin
Adjusts the lower bound of a range given a new upper bound.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Number & Comparable<T>>
voidadjustRange(Settings settings, SettingKey key, T otherValue)
Adjust givenkey
based onotherValue
.
-
-
-
Method Detail
-
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
-
-