Class ItemSetting<T>

  • Type Parameters:
    T - The type of data stored under this ItemSetting


    public class ItemSetting<T>
    extends Object
    This class represents a Setting for a SlimefunItem that can be modified via the Items.yml Config file.
    Author:
    TheBusyBiscuit
    • Constructor Detail

      • ItemSetting

        public ItemSetting​(String key,
                           T defaultValue)
        This creates a new ItemSetting with the given key and default value
        Parameters:
        key - The key under which this setting will be stored (relative to the SlimefunItem)
        defaultValue - The default value for this ItemSetting
    • Method Detail

      • update

        public void update​(T newValue)
        This method updates this ItemSetting with the given value. Override this method to catch changes of a value. A value may never be null.
        Parameters:
        newValue - The new value for this ItemSetting
      • getKey

        public String getKey​()
        This returns the key of this ItemSetting.
        Returns:
        The key under which this setting is stored (relative to the SlimefunItem)
      • getValue

        public T getValue​()
        This returns the current value of this ItemSetting.
        Returns:
        The current value
      • getDefaultValue

        public T getDefaultValue​()
        This returns the default value of this ItemSetting.
        Returns:
        The default value