Interface Producer<O>

  • Type Parameters:
    O - The type of objects produced.
    All Superinterfaces:
    Supplier<O>
    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 Producer<O>
    extends Supplier<O>
    A Supplier that creates a new object each time.

    This is a functional interface whose functional method is create(). Invoking Supplier.get() simply delegates to create().

    This interface can also be thought of as a nullary (arity 0) function, although the functional method is named create rather than apply.

    Author:
    Curtis Rueden
    • Method Detail

      • create

        O create()
      • get

        default O get()
        Specified by:
        get in interface Supplier<O>