Package codechicken.lib.config
Interface Restriction
- All Superinterfaces:
Predicate<ConfigValue>
- All Known Implementing Classes:
Restriction.DoubleRange,Restriction.IntRange
Represents a restriction that can be applied to a
ConfigValue.
Created by covers1624 on 17/4/22.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final record -
Method Summary
Modifier and TypeMethodDescriptiondescribe()Describe thisRestrictionfor display.static RestrictiondoubleRange(double min, double max) Represents a Double range restriction.static RestrictionintRange(int min, int max) Represents an Integer range restriction.booleantest(ConfigValue configValue)
-
Method Details
-
test
- Specified by:
testin interfacePredicate<ConfigValue>
-
describe
String describe()Describe thisRestrictionfor display.- Returns:
- The description.
-
intRange
Represents an Integer range restriction. The value must passmin <= value <= max- Parameters:
min- The minimum value. (inclusive)max- The maximum value. (inclusive)- Returns:
- The Restriction.
-
doubleRange
Represents a Double range restriction. The value must passmin <= value <= max- Parameters:
min- The minimum value. (inclusive)max- The maximum value. (inclusive)- Returns:
- The Restriction.
-