Interface PartMapper_v0_3
- All Known Implementing Classes:
PartMapper_v0_3Impl
public interface PartMapper_v0_3
Bidirectional mapper for converting Part types between A2A Protocol v0.3 and v1.0.
Handles polymorphic Part conversion for:
Key differences:
- v0.3: Part types are records with accessor methods (e.g.,
text(),metadata()) - v1.0: Part types are records with accessor methods (e.g.,
text(),metadata())
Uses manual instanceof dispatch to handle polymorphic conversion.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PartMapper_v0_3Singleton instance accessed viaA2AMappers_v0_3factory. -
Method Summary
-
Field Details
-
INSTANCE
Singleton instance accessed viaA2AMappers_v0_3factory.
-
-
Method Details
-
toV10
Converts v0.3 Part to v1.0 Part.Handles TextPart, FilePart, and DataPart polymorphism using instanceof dispatch.
- Parameters:
v03- the v0.3 part- Returns:
- the equivalent v1.0 part
- Throws:
InvalidRequestError- if the part type is unrecognized
-
fromV10
Converts v1.0 Part to v0.3 Part.Handles TextPart, FilePart, and DataPart polymorphism using instanceof dispatch.
- Parameters:
v10- the v1.0 part- Returns:
- the equivalent v0.3 part
- Throws:
InvalidRequestError- if the part type is unrecognized
-