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 Details

  • Method Details

    • toV10

      default FileContent toV10(FileContent_v0_3 v03)
      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

      default FileContent_v0_3 fromV10(FileContent v10)
      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