Package org.a2aproject.sdk.grpc.mapper
Interface TaskStateMapper
- All Known Implementing Classes:
TaskStateMapperImpl
public interface TaskStateMapper
Mapper between
TaskState and TaskState.
Handles the conversion between domain TaskState enum (with string-based wire format) and protobuf TaskState enum (with integer-based wire format and TASK_STATE_ prefix).
Note: Proto uses CANCELLED spelling while domain uses CANCELED.
Manual Implementation Required: Uses manual switch statements instead of @ValueMapping to avoid mapstruct-spi-protobuf enum strategy initialization issues.
-
Field Summary
Fields -
Method Summary
-
Field Details
-
INSTANCE
-
-
Method Details
-
toProto
Converts domain TaskState to proto TaskState.- Parameters:
domain- the domain task state- Returns:
- the proto task state, or TASK_STATE_UNSPECIFIED if input is null
-
fromProto
Converts proto TaskState to domain TaskState.- Parameters:
proto- the proto task state- Returns:
- the domain task state, or UNKNOWN if input is null or unrecognized
-