Package codechicken.lib.config
Interface ListRestriction
- All Known Implementing Classes:
ListRestriction.DoubleRange,ListRestriction.IntRange
public interface ListRestriction
Represents a restriction that can be applied to a
ConfigValueList.
Created by covers1624 on 19/5/22.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final recordstatic final record -
Method Summary
Modifier and TypeMethodDescriptiondescribe()Describe thisListRestrictionfor display.static ListRestrictiondoubleRange(double min, double max) Represents a Double range restriction.static ListRestrictionintRange(int min, int max) Represents an Integer range restriction.test(ConfigValueList values) Test the providedConfigValueListagainst thisListRestriction.
-
Method Details
-
test
Test the providedConfigValueListagainst thisListRestriction.- Parameters:
values- TheConfigValueListto test.- Returns:
- The result. Empty if the test passes, otherwise contains the first index and value that does not pass.
-
describe
String describe()Describe thisListRestrictionfor 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.
-