Top Description Methods
org.osgi.util.function

public Interface Supplier<T>

Annotations
@ConsumerType
@FunctionalInterface
Type Parameters
<T>
The type of the function output.
Static Imports
java.util.Objects.requireNonNull

A function that produces a result.

This is a functional interface and can be used as the assignment target for a lambda expression or method reference.

Author
$Id: ff7dbe51a4cadfb8e4088620586584a150beb9b8 $

Method Summary

Modifier and TypeMethod and Description
public static <
The type of the function output.
T
>
Supplier<T>

Returns:

A java.util.function.Supplier which wraps the specified Supplier.
asJavaSupplier
(Supplier<T>
The Supplier to wrap. Must not be null.
wrapped
)

Returns a java.util.function.Supplier which wraps the specified Supplier and throws any thrown exceptions.

public static <
The type of the function output.
T
>
Supplier<T>

Returns:

A java.util.function.Supplier which wraps the specified Supplier and the specified value.
asJavaSupplierOrElse
(Supplier<T>
The Supplier to wrap. Must not be null.
wrapped
,
T
The value to return if the specified Supplier throws an Exception.
orElse
)

Returns a java.util.function.Supplier which wraps the specified Supplier and the specified value.

public static <
The type of the function output.
T
>
Supplier<T>

Returns:

A java.util.function.Supplier which wraps the specified Supplier and the specified java.util.function.Supplier.
asJavaSupplierOrElseGet
(Supplier<T>
The Supplier to wrap. Must not be null.
wrapped
,
Supplier<? extends T>
The java.util.function.Supplier to call for a return value if the specified Supplier throws an Exception.
orElseGet
)

Returns a java.util.function.Supplier which wraps the specified Supplier and the specified java.util.function.Supplier.

public static <
The type of the function output.
T
>
Supplier<T>

Returns:

A Supplier which wraps the specified java.util.Supplier.Function.
asSupplier
(Supplier<T>
The java.util.function.Supplier to wrap. Must not be null.
wrapped
)

Returns a Supplier which wraps the specified java.util.function.Supplier.

public T

Returns:

The output of this function.
get
()

Returns a value.

Method Detail

asJavaSupplierback to summary
public static <T> Supplier<T> asJavaSupplier(Supplier<T> wrapped)

Returns a java.util.function.Supplier which wraps the specified Supplier and throws any thrown exceptions.

The returned java.util.function.Supplier will throw any exception thrown by the wrapped Supplier.

Parameters
<T>
The type of the function output.
wrapped:Supplier<T>

The Supplier to wrap. Must not be null.

Returns:Supplier<T>

A java.util.function.Supplier which wraps the specified Supplier.

asJavaSupplierOrElseback to summary
public static <T> Supplier<T> asJavaSupplierOrElse(Supplier<T> wrapped, T orElse)

Returns a java.util.function.Supplier which wraps the specified Supplier and the specified value.

If the the specified Supplier throws an Exception, the the specified value is returned.

Parameters
<T>
The type of the function output.
wrapped:Supplier<T>

The Supplier to wrap. Must not be null.

orElse:T

The value to return if the specified Supplier throws an Exception.

Returns:Supplier<T>

A java.util.function.Supplier which wraps the specified Supplier and the specified value.

asJavaSupplierOrElseGetback to summary
public static <T> Supplier<T> asJavaSupplierOrElseGet(Supplier<T> wrapped, Supplier<? extends T> orElseGet)

Returns a java.util.function.Supplier which wraps the specified Supplier and the specified java.util.function.Supplier.

If the the specified Supplier throws an Exception, the value returned by the specified java.util.function.Supplier is returned.

Parameters
<T>
The type of the function output.
wrapped:Supplier<T>

The Supplier to wrap. Must not be null.

orElseGet:Supplier<? extends T>

The java.util.function.Supplier to call for a return value if the specified Supplier throws an Exception.

Returns:Supplier<T>

A java.util.function.Supplier which wraps the specified Supplier and the specified java.util.function.Supplier.

asSupplierback to summary
public static <T> Supplier<T> asSupplier(Supplier<T> wrapped)

Returns a Supplier which wraps the specified java.util.function.Supplier.

Parameters
<T>
The type of the function output.
wrapped:Supplier<T>

The java.util.function.Supplier to wrap. Must not be null.

Returns:Supplier<T>

A Supplier which wraps the specified java.util.Supplier.Function.

getback to summary
public T get() throws Exception

Returns a value.

Returns:T

The output of this function.

Exceptions
Exception:
An exception thrown by the method.