Class SettingsEntry<T>

  • Type Parameters:
    T - the type of the values

    public class SettingsEntry<T>
    extends java.lang.Object
    An entry in the settings file. It consists of a key/value pair and a comment that explains the entry.
    • Constructor Summary

      Constructors 
      Constructor Description
      SettingsEntry​(@NotNull java.lang.String key, T defaultValue, @Nullable java.lang.String comment)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable java.lang.String getComment()
      Returns the command to add to the settings file.
      T getDefaultValue()
      Returns the default value if the key is missing from the settings file.
      @NotNull java.lang.String getKey()
      Returns the key in the settings file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SettingsEntry

        public SettingsEntry​(@NotNull
                             @NotNull java.lang.String key,
                             @NotNull
                             T defaultValue,
                             @Nullable
                             @Nullable java.lang.String comment)
        Creates a new instance.
        Parameters:
        key - the key in the settings file
        defaultValue - the default value if the key is missing from the settings file
        comment - the comment to add to the settings file or null if unknown
    • Method Detail

      • getKey

        @NotNull
        public @NotNull java.lang.String getKey()
        Returns the key in the settings file.
        Returns:
        the key
      • getDefaultValue

        @NotNull
        public T getDefaultValue()
        Returns the default value if the key is missing from the settings file.
        Returns:
        the default value
      • getComment

        @Nullable
        public @Nullable java.lang.String getComment()
        Returns the command to add to the settings file.
        Returns:
        the comment or null if unknown