Class SupplierUtils
java.lang.Object
org.springframework.util.function.SupplierUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionResolve a givenSupplier, getting its result or immediately returning the given Object as-is if not aSupplier.Resolve the givenSupplier, getting its result or immediately returningnullif the supplier itself wasnull.
-
Constructor Details
-
SupplierUtils
public SupplierUtils()
-
-
Method Details
-
resolve
@Contract("null -> null") public static <T extends @Nullable Object> @Nullable T resolve(@Nullable Supplier<T> supplier) 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
-