Interface SettingKey

All Superinterfaces:
Comparable<SettingKey>
All Known Implementing Classes:
InternalKey

public interface SettingKey extends Comparable<SettingKey>
A setting key represents a configuration item and has the following properties:
  • propertyKey() - property name that can be used in a configuration file
  • defaultValue() - that will be used if there is no configuration file present
Since:
1.0.1
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether the value for this key can be set to null.
    default <T extends Number & Comparable<T>>
    void
    autoAdjust(@NotNull Settings settings, T otherValue)
    Auto-adjusts the Settings value for this key based on the value of another setting key.
    <T> T
    Default value for this key.
    A property key that can be used to configure this setting in a properties file.
    <T> Class<T>
    Type of the property value.

    Methods inherited from interface java.lang.Comparable

    compareTo
  • Method Details

    • propertyKey

      String propertyKey()
      A property key that can be used to configure this setting in a properties file.
      Returns:
      property key
      Since:
      1.2.0
    • type

      <T> Class<T> type()
      Type of the property value.
      Returns:
      value class
      Since:
      1.0.1
    • defaultValue

      <T> T defaultValue()
      Default value for this key.
      Type Parameters:
      T - type of the value
      Returns:
      default value
      Since:
      1.0.1
    • allowsNullValue

      boolean allowsNullValue()
      Indicates whether the value for this key can be set to null.
      Returns:
      true if null is allowed, false otherwise
      Since:
      1.5.1
    • autoAdjust

      default <T extends Number & Comparable<T>> void autoAdjust(@NotNull @NotNull Settings settings, @NotNull T otherValue)
      Auto-adjusts the Settings value for this key based on the value of another setting key.
      Parameters:
      settings - to adjust
      otherValue - value of the other setting to base the adjustment off
      Since:
      1.2.0