Class Preference.Numeric.NumericBuilder<T extends Number & Comparable<T>>
java.lang.Object
dev.mintychochip.mint.preferences.Preference.Numeric.NumericBuilder<T>
- Type Parameters:
T- the numeric type
- Enclosing interface:
Preference.Numeric<T extends Number & Comparable<T>>
@Experimental
@AvailableSince("1.3")
public static final class Preference.Numeric.NumericBuilder<T extends Number & Comparable<T>>
extends Object
Builder for constructing numeric preferences with range constraints.
- Since:
- 1.3
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the numeric preference instance.description(net.kyori.adventure.text.Component description) Sets the description for this preference.displayName(net.kyori.adventure.text.Component displayName) Sets the display name for this preference.Sets the maximum allowed value.Sets the minimum allowed value.Sets both minimum and maximum values.
-
Method Details
-
min
Sets the minimum allowed value.- Parameters:
min- the minimum value- Returns:
- this builder
-
max
Sets the maximum allowed value.- Parameters:
max- the maximum value- Returns:
- this builder
-
range
Sets both minimum and maximum values.- Parameters:
min- the minimum valuemax- the maximum value- Returns:
- this builder
-
displayName
@AvailableSince("1.3") public Preference.Numeric.NumericBuilder<T> displayName(net.kyori.adventure.text.Component displayName) Sets the display name for this preference.- Parameters:
displayName- the display name component- Returns:
- this builder
-
description
@AvailableSince("1.3") public Preference.Numeric.NumericBuilder<T> description(net.kyori.adventure.text.Component description) Sets the description for this preference.- Parameters:
description- the description component- Returns:
- this builder
-
build
Builds the numeric preference instance.- Returns:
- the constructed numeric preference
- Throws:
IllegalArgumentException- if min > max or default is out of range
-