Interface FileContentMapper_v0_3
- All Known Implementing Classes:
FileContentMapper_v0_3Impl
public interface FileContentMapper_v0_3
Bidirectional mapper for converting FileContent types between A2A Protocol v0.3 and v1.0.
Handles polymorphic FileContent conversion for:
Key differences:
- v0.3: FileWithBytes and FileWithUri are simple records
- v1.0: FileWithBytes is a complex class with lazy loading; FileWithUri is a simple record
The conversion preserves the mimeType, name, and content (bytes or uri) fields across both versions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FileContentMapper_v0_3Singleton instance accessed viaA2AMappers_v0_3factory. -
Method Summary
Modifier and TypeMethodDescriptiondefault FileContent_v0_3fromV10(FileContent v10) Converts v1.0 FileContent to v0.3 FileContent.default FileContenttoV10(FileContent_v0_3 v03) Converts v0.3 FileContent to v1.0 FileContent.
-
Field Details
-
INSTANCE
Singleton instance accessed viaA2AMappers_v0_3factory.
-
-
Method Details
-
toV10
Converts v0.3 FileContent to v1.0 FileContent.Handles FileWithBytes and FileWithUri polymorphism using instanceof dispatch.
- Parameters:
v03- the v0.3 file content- Returns:
- the equivalent v1.0 file content
- Throws:
InvalidRequestError- if the file content type is unrecognized
-
fromV10
Converts v1.0 FileContent to v0.3 FileContent.Handles FileWithBytes and FileWithUri polymorphism using instanceof dispatch.
- Parameters:
v10- the v1.0 file content- Returns:
- the equivalent v0.3 file content
- Throws:
InvalidRequestError- if the file content type is unrecognized
-