Interface Property<T>

    • Method Detail

      • string

        static Property<java.lang.String> string​(java.lang.String name)
      • string

        static Property<java.lang.String> string​(java.lang.String name,
                                                 java.lang.String def)
      • bool

        static Property<java.lang.Boolean> bool​(java.lang.String name)
      • bool

        static Property<java.lang.Boolean> bool​(java.lang.String name,
                                                boolean def)
      • integer

        static Property<java.lang.Integer> integer​(java.lang.String name)
      • integer

        static Property<java.lang.Integer> integer​(java.lang.String name,
                                                   int def)
      • long_

        static Property<java.lang.Long> long_​(java.lang.String name)
      • long_

        static Property<java.lang.Long> long_​(java.lang.String name,
                                              long def)
      • enum_

        static <T extends java.lang.Enum<T>> Property<T> enum_​(java.lang.String name,
                                                               java.lang.Class<T> type)
      • enum_

        static <T extends java.lang.Enum<T>> Property<T> enum_​(java.lang.String name,
                                                               java.lang.Class<T> type,
                                                               T def)
      • duration

        static Property<java.time.Duration> duration​(java.lang.String name)
      • duration

        static Property<java.time.Duration> duration​(java.lang.String name,
                                                     java.time.Duration def)
      • duration

        static Property<java.time.Duration> duration​(java.lang.String name,
                                                     java.time.Duration def,
                                                     java.time.Duration min)
      • durationSec

        static Property<java.time.Duration> durationSec​(java.lang.String name)
      • durationSec

        static Property<java.time.Duration> durationSec​(java.lang.String name,
                                                        java.time.Duration def)
      • durationSec

        static Property<java.time.Duration> durationSec​(java.lang.String name,
                                                        java.time.Duration def,
                                                        java.time.Duration min)
      • charset

        static Property<java.nio.charset.Charset> charset​(java.lang.String name)
      • charset

        static Property<java.nio.charset.Charset> charset​(java.lang.String name,
                                                          java.nio.charset.Charset def)
      • object

        static Property<java.lang.Object> object​(java.lang.String name)
      • object

        static Property<java.lang.Object> object​(java.lang.String name,
                                                 java.lang.Object def)
      • validating

        static <T> Property<T> validating​(Property<T> prop,
                                          java.util.function.Consumer<? super T> validator)
      • getType

        java.lang.Class<T> getType()
        Returns:
        Property type - Note: for primitive types the wrapper equivalent is returned
      • getDefault

        java.util.Optional<T> getDefault()
        Returns:
        The Optional pre-defined default value
      • getRequiredDefault

        default T getRequiredDefault()
      • get

        java.util.Optional<T> get​(PropertyResolver resolver)
        Parameters:
        resolver - The PropertyResolver to query for the property value.
        Returns:
        The Optional result - if resolver contains a value then the resolver's value, otherwise the pre-defined default
      • getRequired

        default T getRequired​(PropertyResolver resolver)
        Parameters:
        resolver - The PropertyResolver to query for the property value.
        Returns:
        The resolved value
        Throws:
        java.util.NoSuchElementException - if resolver contains no value and no getDefault() defined
      • getOrNull

        default T getOrNull​(PropertyResolver resolver)
        Parameters:
        resolver - The PropertyResolver to query for the property value.
        Returns:
        The resolver's value or null if no specific value found in the resolver - regardless of whether there is a default value
      • getOrCustomDefault

        T getOrCustomDefault​(PropertyResolver resolver,
                             T defaultValue)
        Parameters:
        resolver - The PropertyResolver to query for the property value.
        defaultValue - The default value to return if no specific value found in resolver
        Returns:
        The resolver's value or specified default if no specific value found in the resolver - regardless of whether there is a default value