Class TaskStatusPollResponse

java.lang.Object
ai.docling.serve.api.task.response.TaskStatusPollResponse

public class TaskStatusPollResponse extends Object
Represents the response for polling the status of a task. This class encapsulates details about a specific task's current status, including its identifier, type, position in a queue, and metadata regarding its progress and outcomes. The object is serialized and deserialized using Jackson annotations, ensuring compatibility with JSON-based APIs. Features: - Uses a builder pattern with lombok.Builder for creating immutable objects. - Serialized to JSON only if fields are non-empty. - Metadata field for detailed task status is optional. Fields: - taskId: The unique identifier for the task. - taskType: The type of task being processed (optional). - taskStatus: The current status of the task, as defined in the TaskStatus enum. - taskPosition: A numerical representation of the task's position in the processing queue. - taskStatusMetadata: Metadata providing detailed statistics and progress information (optional).
  • Method Details

    • builder

      public static @NonNull TaskStatusPollResponse.Builder builder()
    • toBuilder

      public @NonNull TaskStatusPollResponse.Builder toBuilder()
    • getTaskId

      public String getTaskId()
      Unique task identifier.
      Returns:
      the task ID
    • getTaskType

      public @Nullable String getTaskType()
      Type of task (convert or chunk).
      Returns:
      the task type, or null if not specified
    • getTaskStatus

      public TaskStatus getTaskStatus()
      Current status of the task.
      Returns:
      the task status
    • getTaskPosition

      public @Nullable Long getTaskPosition()
      Position of task in the processing queue (if queued).
      Returns:
      the queue position, or null if not queued
    • getTaskStatusMetadata

      public @Nullable TaskStatusMetadata getTaskStatusMetadata()
      Metadata about task processing progress.
      Returns:
      the task metadata, or null if not available
    • toString

      public @NonNull String toString()
      Overrides:
      toString in class Object