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 Details

    • min

      @AvailableSince("1.3") public Preference.Numeric.NumericBuilder<T> min(T min)
      Sets the minimum allowed value.
      Parameters:
      min - the minimum value
      Returns:
      this builder
    • max

      @AvailableSince("1.3") public Preference.Numeric.NumericBuilder<T> max(T max)
      Sets the maximum allowed value.
      Parameters:
      max - the maximum value
      Returns:
      this builder
    • range

      @AvailableSince("1.3") public Preference.Numeric.NumericBuilder<T> range(T min, T max)
      Sets both minimum and maximum values.
      Parameters:
      min - the minimum value
      max - 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

      @AvailableSince("1.3") public Preference.Numeric<T> build()
      Builds the numeric preference instance.
      Returns:
      the constructed numeric preference
      Throws:
      IllegalArgumentException - if min > max or default is out of range