Interface SettingKey<T>

Type Parameters:
T - type of the value

public interface SettingKey<T>
A setting key represents a configuration item that can be stored in a Settings instance.
Since:
1.0.1
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A builder for creating custom keys.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Indicates whether the value for this key can be set to null.
    default T
    Default value for this key.
    A unique property key identifying this setting.
    The type of value associated with this key.
  • Method Details

    • type

      Class<T> type()
      The type of value associated with this key.

      This method is used for converting a value from a string to the specified type() when retrieving the value from Settings.

      Returns:
      the type of value associated with this key
      Since:
      1.0.1
    • propertyKey

      String propertyKey()
      A unique property key identifying this setting. The property key is used to identify the setting in a properties file.
      Returns:
      a unique property key identifying this setting
      Since:
      1.2.0
    • defaultValue

      default T defaultValue()
      Default value for this key.
      Returns:
      default value, or null if not defined
      Since:
      1.0.1
    • allowsNullValue

      default boolean allowsNullValue()
      Indicates whether the value for this key can be set to null. Setting a null for a key that does not accept null will produce an exception.
      Returns:
      true if null is allowed, false otherwise
      Since:
      1.5.1