Interface DefaultValueFactory<C,T>

Type Parameters:
C - command sender type
T - value type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @API(status=STABLE) public interface DefaultValueFactory<C,T>
Factory that produces default value instances.
  • Method Details

    • constant

      static <C, T> @NonNull DefaultValueFactory<C,T> constant(@NonNull DefaultValue<C,T> defaultValue)
      Creates a default value factory that always returns the given defaultValue.
      Type Parameters:
      C - command sender type
      T - type of the value
      Parameters:
      defaultValue - default value instance
      Returns:
      the created factory
    • create

      @NonNull DefaultValue<C,T> create(@NonNull Parameter parameter)
      Creates the default value.
      Parameters:
      parameter - parameter to create the default value for
      Returns:
      the default value