Class Setting<T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String path  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Setting​(java.lang.String path, Type<T> type)  
      protected Setting​(java.lang.String path, Type<T> type, java.util.function.Predicate<T> validator)  
      protected Setting​(java.lang.String path, java.lang.Class<T> type)  
      protected Setting​(java.lang.String path, java.lang.Class<T> type, java.util.function.Predicate<T> validator)  
      protected Setting​(java.lang.String path, java.util.function.Predicate<T> validator, T defaultValue)  
      protected Setting​(java.lang.String path, T defaultValue)  
    • Field Detail

      • path

        protected final java.lang.String path
    • Constructor Detail

      • Setting

        protected Setting​(java.lang.String path,
                          java.lang.Class<T> type)
      • Setting

        protected Setting​(java.lang.String path,
                          java.lang.Class<T> type,
                          java.util.function.Predicate<T> validator)
      • Setting

        protected Setting​(java.lang.String path,
                          Type<T> type)
      • Setting

        protected Setting​(java.lang.String path,
                          Type<T> type,
                          java.util.function.Predicate<T> validator)
      • Setting

        protected Setting​(java.lang.String path,
                          T defaultValue)
      • Setting

        protected Setting​(java.lang.String path,
                          java.util.function.Predicate<T> validator,
                          T defaultValue)
    • Method Detail

      • nullValidator

        public static <T> boolean nullValidator​(T value)
      • timeValidator

        public static boolean timeValidator​(java.lang.Number number)
      • getPath

        public java.lang.String getPath()
        Used to get the String path of a the config setting.

        Path separates nested levels with a dot.

        Returns:
        Example: Settings.WebServer.Enabled
      • getValueFrom

        public abstract T getValueFrom​(ConfigNode node)
      • isValid

        public boolean isValid​(T value)
      • isInvalid

        public boolean isInvalid​(T value)
      • getDefaultValue

        public T getDefaultValue()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object