类 SupplierUtils

java.lang.Object
cn.taketoday.util.function.SupplierUtils

public abstract class SupplierUtils extends Object
Convenience utilities for Supplier handling.
从以下版本开始:
4.0 2022/3/9 20:55
作者:
Juergen Hoeller, Harry Yang
另请参阅:
  • 构造器详细资料

    • SupplierUtils

      public SupplierUtils()
  • 方法详细资料

    • resolve

      @Nullable public static <T> T resolve(@Nullable Supplier<T> supplier)
      Resolve the given Supplier, getting its result or immediately returning null if the supplier itself was null.
      参数:
      supplier - the supplier to resolve
      返回:
      the supplier's result, or null if none
    • resolve

      @Nullable public static Object resolve(@Nullable Object candidate)
      Resolve a given Supplier, getting its result or immediately returning the given Object as-is if not a Supplier.
      参数:
      candidate - the candidate to resolve (potentially a Supplier)
      返回:
      a supplier's result or the given Object as-is