Package org.a2aproject.sdk.grpc.mapper
Interface SubscribeToTaskRequestMapper
- All Known Implementing Classes:
SubscribeToTaskRequestMapperImpl
public interface SubscribeToTaskRequestMapper
Mapper between
SubscribeToTaskRequest and SubscribeToTaskRequest.
The mapping handles the structural difference between domain and proto representations:
- Domain: Full JSONRPC request with id, jsonrpc, method, and params (TaskIdParams)
- Proto: Simple request with name field in format "tasks/{task_id}"
Note: The domain object is a complete JSONRPC request, while the proto is just the gRPC request parameters. The JSONRPC envelope (id, jsonrpc, method) is handled separately by the transport layer.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault SubscribeToTaskRequestfromProto(SubscribeToTaskRequest proto) Converts proto SubscribeToTaskRequest to domain SubscribeToTaskRequest.default SubscribeToTaskRequesttoProto(SubscribeToTaskRequest domain) Converts domain SubscribeToTaskRequest to proto SubscribeToTaskRequest.
-
Field Details
-
INSTANCE
-
-
Method Details
-
toProto
Converts domain SubscribeToTaskRequest to proto SubscribeToTaskRequest. Extracts the task ID from params and formats it as "tasks/{task_id}".- Parameters:
domain- the domain SubscribeToTaskRequest- Returns:
- the proto SubscribeToTaskRequest
-
fromProto
Converts proto SubscribeToTaskRequest to domain SubscribeToTaskRequest. Extracts the task ID from the name field and creates a TaskIdParams.- Parameters:
proto- the proto SubscribeToTaskRequest- Returns:
- the domain SubscribeToTaskRequest
-