Package com.alibaba.cloud.ai.util
Class StateUtils
java.lang.Object
com.alibaba.cloud.ai.util.StateUtils
状态管理工具类,提供类型安全的状态获取方法
- Author:
- zhangshenghang
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.springframework.ai.document.Document>getDocumentList(OverAllState state, String key) 获取Document列表getDocumentListList(OverAllState state, String key) 获取Document列表的列表static <T> List<T>getListValue(OverAllState state, String key) 安全获取列表类型状态值static <T> TgetObjectValue(OverAllState state, String key, Class<T> type) 安全获取对象类型状态值static <T> TgetObjectValue(OverAllState state, String key, Class<T> type, Supplier<T> defaultSupplier) 安全获取对象类型状态值,带默认值提供器static <T> TgetObjectValue(OverAllState state, String key, Class<T> type, T defaultValue) 安全获取对象类型状态值,带默认值static StringgetStringValue(OverAllState state, String key) 安全获取字符串类型状态值static StringgetStringValue(OverAllState state, String key, String defaultValue) 安全获取字符串类型状态值,带默认值static booleanhasValue(OverAllState state, String key) 检查状态值是否存在
-
Constructor Details
-
StateUtils
public StateUtils()
-
-
Method Details
-
getStringValue
安全获取字符串类型状态值 -
getStringValue
安全获取字符串类型状态值,带默认值 -
getListValue
安全获取列表类型状态值 -
getObjectValue
安全获取对象类型状态值 -
getObjectValue
安全获取对象类型状态值,带默认值 -
getObjectValue
public static <T> T getObjectValue(OverAllState state, String key, Class<T> type, Supplier<T> defaultSupplier) 安全获取对象类型状态值,带默认值提供器 -
hasValue
检查状态值是否存在 -
getDocumentList
public static List<org.springframework.ai.document.Document> getDocumentList(OverAllState state, String key) 获取Document列表 -
getDocumentListList
public static List<List<org.springframework.ai.document.Document>> getDocumentListList(OverAllState state, String key) 获取Document列表的列表
-