Suppliers (Apache Commons Lang 3.17.0 API)
Description: declaration: package: org.apache.commons.lang3.function, class: Suppliers

Package org.apache.commons.lang3.function

# Class Suppliers

java.lang.Object
org.apache.commons.lang3.function.Suppliers

public class Suppliers extends Object
Helps use `Supplier`.

Since:
  3.13.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Suppliers()`
  Deprecated.
  TODO Make private in 4.0.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static <T> T`
  `get(Supplier<T> supplier)`
  Null-safe call to `Supplier.get()`.
  `static <T> Supplier<T>`
  `nul()`
  Returns the singleton supplier that always returns null.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Suppliers

    @Deprecated public Suppliers()
    Deprecated.
    TODO Make private in 4.0.
    Make private in 4.0.

- ## Method Details

  - ### get

    public static <T> T get(Supplier<T> supplier)
    Null-safe call to `Supplier.get()`.
    Type Parameters:
      `T` - the type of results supplied by this supplier.
    Parameters:
      `supplier` - the supplier or null.
    Returns:
      Result of `Supplier.get()` or null.

  - ### nul

    public static <T> Supplier<T> nul()
    Returns the singleton supplier that always returns null.

    This supplier never throws an exception.

    Type Parameters:
      `T` - Supplied type.
    Returns:
      The NUL singleton.
    Since:
      3.14.0