Top Description Methods
com.google.common.base

public Interface Supplier<T extends @Nullable Object>

extends Supplier<T extends @Nullable Object>
Known Direct Subinterfaces
com.google.common.hash.ImmutableSupplier
Known Direct Implementers
com.google.common.base.Suppliers.SupplierComposition, com.google.common.base.Suppliers.MemoizingSupplier, com.google.common.base.Suppliers.NonSerializableMemoizingSupplier, com.google.common.base.Suppliers.ExpiringMemoizingSupplier, com.google.common.base.Suppliers.SupplierOfInstance, com.google.common.base.Suppliers.ThreadSafeSupplier, com.google.common.collect.HashBasedTable.Factory, com.google.common.collect.MultimapBuilder.ArrayListSupplier, com.google.common.collect.MultimapBuilder.LinkedListSupplier, com.google.common.collect.MultimapBuilder.HashSetSupplier, com.google.common.collect.MultimapBuilder.LinkedHashSetSupplier, com.google.common.collect.MultimapBuilder.TreeSetSupplier, com.google.common.collect.MultimapBuilder.EnumSetSupplier, com.google.common.collect.TreeBasedTable.Factory, com.google.common.util.concurrent.AbstractIdleService.ThreadNameSupplier
Annotations
@GwtCompatible
@FunctionalInterface
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, org.checkerframework.checker.nullness.qual.Nullable

Legacy version of 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.

Author
Harry Heymann
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

an instance of the appropriate type
get
()

Redeclares java.util.function.Supplier.get.

Retrieves an instance of the appropriate type.

Method Detail

getback to summary
public T get()

Redeclares java.util.function.Supplier.get.

Retrieves an instance of the appropriate type. The returned object may or may not be a new instance, depending on the implementation.

Returns:T

an instance of the appropriate type

Annotations
@Override
@ParametricNullness