public final class AcpInvocationContext
extends java.lang.Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
AcpInvocationContext.Builder
Builder for AcpInvocationContext.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static AcpInvocationContext.Builder |
builder()
Create a new builder.
|
java.lang.String |
getAcpMethod()
Get the ACP method name (e.g., "initialize", "session/prompt").
|
java.util.Optional<java.lang.Object> |
getAttribute(java.lang.String name)
Get a custom attribute.
|
<T> java.util.Optional<T> |
getAttribute(java.lang.String name,
java.lang.Class<T> type)
Get a typed custom attribute.
|
java.util.Optional<NegotiatedCapabilities> |
getCapabilities()
Get the negotiated capabilities.
|
java.util.Optional<PromptContext> |
getPromptContext()
Get the async prompt context if available.
|
java.lang.Object |
getRequest()
Get the request object.
|
<T> T |
getRequest(java.lang.Class<T> type)
Get the request cast to a specific type.
|
java.util.Optional<java.lang.String> |
getSessionId()
Get the session ID if available.
|
java.util.Optional<SyncPromptContext> |
getSyncPromptContext()
Get the sync prompt context if available.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set a custom attribute.
|
public static AcpInvocationContext.Builder builder()
public java.lang.String getAcpMethod()
public java.lang.Object getRequest()
public <T> T getRequest(java.lang.Class<T> type)
T - the typetype - the expected typejava.lang.ClassCastException - if the request is not of the expected typepublic java.util.Optional<java.lang.String> getSessionId()
public java.util.Optional<PromptContext> getPromptContext()
public java.util.Optional<SyncPromptContext> getSyncPromptContext()
public java.util.Optional<NegotiatedCapabilities> getCapabilities()
public void setAttribute(java.lang.String name,
java.lang.Object value)
name - attribute namevalue - attribute valuepublic java.util.Optional<java.lang.Object> getAttribute(java.lang.String name)
name - attribute namepublic <T> java.util.Optional<T> getAttribute(java.lang.String name,
java.lang.Class<T> type)
T - the typename - attribute nametype - expected type