Interface TaskMapper_v0_3

All Known Implementing Classes:
TaskMapper_v0_3Impl

public interface TaskMapper_v0_3
Bidirectional mapper for converting Task between A2A Protocol v0.3 and v1.0.

Key differences:

  • v0.3: Task is a record with accessor methods (e.g., id(), status())
  • v1.0: Task is a record with accessor methods (e.g., id(), status())
  • v0.3 has a kind field with kind() method
  • v1.0 has a kind() method from the StreamingEventKind interface

The conversion involves mapping nested types:

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TaskMapper_v0_3
    Singleton instance accessed via A2AMappers_v0_3 factory.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Task_v0_3
    Converts v1.0 Task to v0.3 Task.
    default Task
    Converts v0.3 Task to v1.0 Task.
  • Field Details

  • Method Details

    • toV10

      default Task toV10(Task_v0_3 v03)
      Converts v0.3 Task to v1.0 Task.

      Converts all nested objects including status, artifacts, and history using their respective mappers.

      Parameters:
      v03 - the v0.3 task
      Returns:
      the equivalent v1.0 task
    • fromV10

      default Task_v0_3 fromV10(Task v10)
      Converts v1.0 Task to v0.3 Task.

      Converts all nested objects including status, artifacts, and history using their respective mappers.

      Parameters:
      v10 - the v1.0 task
      Returns:
      the equivalent v0.3 task