Class SupplierUtils
java.lang.Object
org.springframework.util.function.SupplierUtils
Convenience utilities for
Supplier
handling.- Since:
- 5.1
- Author:
- Juergen Hoeller
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
Resolve a givenSupplier
, getting its result or immediately returning the given Object as-is if not aSupplier
.static <T> T
Resolve the givenSupplier
, getting its result or immediately returningnull
if the supplier itself wasnull
.
-
Constructor Details
-
SupplierUtils
public SupplierUtils()
-
-
Method Details
-
resolve
Resolve the givenSupplier
, getting its result or immediately returningnull
if the supplier itself wasnull
.- Parameters:
supplier
- the supplier to resolve- Returns:
- the supplier's result, or
null
if none
-
resolve
Resolve a givenSupplier
, getting its result or immediately returning the given Object as-is if not aSupplier
.- Parameters:
candidate
- the candidate to resolve (potentially aSupplier
)- Returns:
- a supplier's result or the given Object as-is
- Since:
- 6.1.4
-