@GwtCompatible @FunctionalInterface public interface Supplier<T> extends Supplier<T>
java.util.function.Supplier
. Semantically,
this could be a factory, generator, builder, closure, or something else entirely. No guarantees
are implied by this interface.
The Suppliers
class provides common suppliers and related utilities.
As this interface extends java.util.function.Supplier
, an instance of this type can be
used as a java.util.function.Supplier
directly. To use a java.util.function.Supplier
in a context where a com.google.common.base.Supplier
is
needed, use supplier::get
.
See the Guava User Guide article on the use of Function
.
Modifier and Type | Method and Description |
---|---|
T |
get()
Retrieves an instance of the appropriate type.
|
Copyright © 2010–2017. All rights reserved.