public class MonoHandler extends java.lang.Object implements ReturnValueHandler
Mono return types for async handlers.
The Mono is unwrapped (blocked) to get the actual response value. For true reactive operation, use the reactive agent API directly.
| 构造器和说明 |
|---|
MonoHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
static java.lang.Class<?> |
getMonoGenericType(AcpMethodParameter returnType)
Get the generic type parameter of the Mono (e.g., PromptResponse from Mono<PromptResponse>).
|
java.lang.Object |
handleReturnValue(java.lang.Object returnValue,
AcpMethodParameter returnType,
AcpInvocationContext context)
Handle the return value and convert to protocol response.
|
boolean |
supportsReturnType(AcpMethodParameter returnType)
Determine whether this handler supports the given return type.
|
public boolean supportsReturnType(AcpMethodParameter returnType)
ReturnValueHandlersupportsReturnType 在接口中 ReturnValueHandlerreturnType - the return type metadatapublic java.lang.Object handleReturnValue(java.lang.Object returnValue,
AcpMethodParameter returnType,
AcpInvocationContext context)
ReturnValueHandlerhandleReturnValue 在接口中 ReturnValueHandlerreturnValue - the value returned by the handler methodreturnType - the return type metadatacontext - the invocation contextpublic static java.lang.Class<?> getMonoGenericType(AcpMethodParameter returnType)
returnType - the return type parameter