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
    Modifier and Type
    Field
    Description
    static final TaskStateMapper
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default TaskState
    Converts proto TaskState to domain TaskState.
    default TaskState
    Converts domain TaskState to proto TaskState.
  • Field Details

  • Method Details

    • toProto

      default TaskState toProto(TaskState domain)
      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

      default TaskState fromProto(TaskState proto)
      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