Class ConfiguredValue<V>

    • Field Detail

      • adapter

        @NotNull
        protected final @NotNull ValueAdapter<V> adapter
    • Constructor Detail

    • Method Detail

      • builderOf

        public static <V> ConfigValueBuilder<V> builderOf​(@NotNull
                                                          @NotNull java.lang.Class<V> type)
      • of

        public static <V> ConfiguredValue<V> of​(@NotNull
                                                @NotNull java.lang.Class<V> type)
      • of

        public static <V> ConfiguredValue<V> of​(@NotNull
                                                @NotNull java.lang.Class<V> type,
                                                @NotNull
                                                V defaults)
      • of

        public static <V> ConfiguredValue<V> of​(@NotNull
                                                @NotNull java.lang.Class<V> type,
                                                @NotNull
                                                @NotNull java.util.function.Supplier<@Nullable V> defaultSupplier)
      • of

        public static <V> ConfiguredValue<V> of​(@NotNull
                                                @NotNull ValueType<V> type,
                                                @NotNull
                                                @NotNull java.util.function.Supplier<@Nullable V> defaultSupplier)
      • adapter

        @NotNull
        public @NotNull ValueAdapter<V> adapter()
        Returns:
        Adapter of this value.
      • parser

        @Nullable
        public @Nullable ValueParser<V> parser()
        Returns:
        Value's parser, parse base object to value.
      • serializer

        @Nullable
        public @Nullable ValueSerializer<V> serializer()
        Returns:
        Value's serializer, parse value to base object.
      • get

        public V get()
        Description copied from class: ConfigValue
        Gets the configured value (i.e., the value read from the source).
        If no default value was written during initialization, you can use the ConfigValue.getOrDefault() method to obtain the default value when this value is empty.
        Specified by:
        get in class ConfigValue<V>
        Returns:
        Configured value
      • set

        public void set​(V value)
        Set the value of the configuration path. Will use serializer() to serialize the value.
        Specified by:
        set in class ConfigValue<V>
        Parameters:
        value - The value to be set