Interface SerializableSupplier<T>

Type Parameters:
T - the output type | 输出类型
All Superinterfaces:
Serializable, Supplier<T>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SerializableSupplier<T> extends Supplier<T>, Serializable
Serializable Supplier Interface 可序列化Supplier接口

A Supplier that is also Serializable, enabling lambda metadata extraction.

一个同时也是Serializable的Supplier,可以提取lambda元数据。

Features | 主要功能:

  • Serializable Supplier for lambda metadata extraction - 可序列化Supplier用于lambda元数据提取
  • Constant and null factory methods - 常量和null工厂方法

Usage Examples | 使用示例:

SerializableSupplier<String> supplier = () -> "hello";
String value = supplier.get(); // "hello"

Security | 安全性:

  • Thread-safe: Depends on implementation - 线程安全: 取决于实现
  • Null-safe: Depends on implementation - 空值安全: 取决于实现
Since:
JDK 25, opencode-base-reflect V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Details

    • of

      static <T> SerializableSupplier<T> of(SerializableSupplier<T> supplier)
      Creates a SerializableSupplier 创建SerializableSupplier
      Type Parameters:
      T - the output type | 输出类型
      Parameters:
      supplier - the supplier | 提供者
      Returns:
      the serializable supplier | 可序列化提供者
    • constant

      static <T> SerializableSupplier<T> constant(T value)
      Creates a constant supplier 创建常量提供者
      Type Parameters:
      T - the output type | 输出类型
      Parameters:
      value - the value to supply | 要提供的值
      Returns:
      the constant supplier | 常量提供者
    • nullSupplier

      static <T> SerializableSupplier<T> nullSupplier()
      Creates a null supplier 创建null提供者
      Type Parameters:
      T - the output type | 输出类型
      Returns:
      the null supplier | null提供者