Interface Factory<T>

Type Parameters:
T - the type of element to create
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Factory<T>
Factory for creating elements of a certain type for a given context.
  • Method Details

    • create

      T create(Context context)
      Create an element using the supplied context.
      Parameters:
      context - the context to use
      Returns:
      the created element
    • createAndConfigure

      default T createAndConfigure(Context context, Consumer<? super T> configurer)
      Create and configure an element using the supplied context and configurer.
      Parameters:
      context - the context to use
      configurer - the configurer to use
      Returns:
      the created element