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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectResolve a givenSupplier, getting its result or immediately returning the given Object as-is if not aSupplier.static <T> TResolve the givenSupplier, getting its result or immediately returningnullif the supplier itself wasnull.
-
Constructor Details
-
SupplierUtils
public SupplierUtils()
-
-
Method Details
-
resolve
Resolve the givenSupplier, getting its result or immediately returningnullif the supplier itself wasnull.- Parameters:
supplier- the supplier to resolve- Returns:
- the supplier's result, or
nullif 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
-