-
- 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>
ASupplierthat creates a new object each time.This is a functional interface whose functional method is
create(). InvokingSupplier.get()simply delegates tocreate().This interface can also be thought of as a nullary (arity 0)
function, although the functional method is namedcreaterather thanapply.- Author:
- Curtis Rueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Ocreate()default Oget()
-