Top Description Fields Constructors Methods
org.apache.commons.lang3.function

public Class Suppliers

extends Object
Class Inheritance
Imports
java.util.function.Supplier

Helps use Supplier.
Since
3.13.0

Field Summary

Modifier and TypeField and Description
private static Supplier<T>
NUL

Returns the singleton supplier that always returns null.

Constructor Summary

AccessConstructor and Description
public
Suppliers()
Deprecated TODO Make private in 4.0.

Make private in 4.0.

Method Summary

Modifier and TypeMethod and Description
public static <
the type of results supplied by this supplier.
T
>
T

Returns:

Result of Supplier#get() or null.
get
(final Supplier<T>
the supplier or null.
supplier
)

Null-safe call to Supplier#get().

public static <
Supplied type.
T
>
Supplier<T>

Returns:

The NUL singleton.
nul
()

Gets the singleton supplier that always returns null.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NULback to summary
private static Supplier<T> NUL

Returns the singleton supplier that always returns null.

This supplier never throws an exception.

Annotations
@SuppressWarnings:rawtypes

Constructor Detail

Suppliersback to summary
public Suppliers()

Deprecated

TODO Make private in 4.0.

Make private in 4.0.

Annotations
@Deprecated

Method Detail

getback to summary
public static <T> T get(final Supplier<T> supplier)

Null-safe call to Supplier#get().

Parameters
<T>
the type of results supplied by this supplier.
supplier:Supplier<T>

the supplier or null.

Returns:T

Result of Supplier#get() or null.

nulback to summary
public static <T> Supplier<T> nul()

Gets the singleton supplier that always returns null.

This supplier never throws an exception.

Parameters
<T>
Supplied type.
Returns:Supplier<T>

The NUL singleton.

Annotations
@SuppressWarnings:unchecked
Since
3.14.0