Class Task.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Task.Builder>
org.a2aproject.sdk.grpc.Task.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable, TaskOrBuilder
Enclosing class:
Task

public static final class Task.Builder extends com.google.protobuf.GeneratedMessage.Builder<Task.Builder> implements TaskOrBuilder
 `Task` is the core unit of action for A2A. It has a current status
 and when results are created for the task they are stored in the
 artifact. If there are multiple turns for a task, these are stored in
 history.
 
Protobuf type lf.a2a.v1.Task
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Task.Builder>
    • clear

      public Task.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<Task.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<Task.Builder>
    • getDefaultInstanceForType

      public Task getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public Task build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Task buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public Task.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Task.Builder>
    • mergeFrom

      public Task.Builder mergeFrom(Task other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<Task.Builder>
    • mergeFrom

      public Task.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Task.Builder>
      Throws:
      IOException
    • getId

      public String getId()
       Unique identifier (e.g. UUID) for the task, generated by the server for a
       new task.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getId in interface TaskOrBuilder
      Returns:
      The id.
    • getIdBytes

      public com.google.protobuf.ByteString getIdBytes()
       Unique identifier (e.g. UUID) for the task, generated by the server for a
       new task.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getIdBytes in interface TaskOrBuilder
      Returns:
      The bytes for id.
    • setId

      public Task.Builder setId(String value)
       Unique identifier (e.g. UUID) for the task, generated by the server for a
       new task.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The id to set.
      Returns:
      This builder for chaining.
    • clearId

      public Task.Builder clearId()
       Unique identifier (e.g. UUID) for the task, generated by the server for a
       new task.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setIdBytes

      public Task.Builder setIdBytes(com.google.protobuf.ByteString value)
       Unique identifier (e.g. UUID) for the task, generated by the server for a
       new task.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for id to set.
      Returns:
      This builder for chaining.
    • getContextId

      public String getContextId()
       Unique identifier (e.g. UUID) for the contextual collection of interactions
       (tasks and messages).
       
      string context_id = 2;
      Specified by:
      getContextId in interface TaskOrBuilder
      Returns:
      The contextId.
    • getContextIdBytes

      public com.google.protobuf.ByteString getContextIdBytes()
       Unique identifier (e.g. UUID) for the contextual collection of interactions
       (tasks and messages).
       
      string context_id = 2;
      Specified by:
      getContextIdBytes in interface TaskOrBuilder
      Returns:
      The bytes for contextId.
    • setContextId

      public Task.Builder setContextId(String value)
       Unique identifier (e.g. UUID) for the contextual collection of interactions
       (tasks and messages).
       
      string context_id = 2;
      Parameters:
      value - The contextId to set.
      Returns:
      This builder for chaining.
    • clearContextId

      public Task.Builder clearContextId()
       Unique identifier (e.g. UUID) for the contextual collection of interactions
       (tasks and messages).
       
      string context_id = 2;
      Returns:
      This builder for chaining.
    • setContextIdBytes

      public Task.Builder setContextIdBytes(com.google.protobuf.ByteString value)
       Unique identifier (e.g. UUID) for the contextual collection of interactions
       (tasks and messages).
       
      string context_id = 2;
      Parameters:
      value - The bytes for contextId to set.
      Returns:
      This builder for chaining.
    • hasStatus

      public boolean hasStatus()
       The current status of a `Task`, including `state` and a `message`.
       
      .lf.a2a.v1.TaskStatus status = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      hasStatus in interface TaskOrBuilder
      Returns:
      Whether the status field is set.
    • getStatus

      public TaskStatus getStatus()
       The current status of a `Task`, including `state` and a `message`.
       
      .lf.a2a.v1.TaskStatus status = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getStatus in interface TaskOrBuilder
      Returns:
      The status.
    • setStatus

      public Task.Builder setStatus(TaskStatus value)
       The current status of a `Task`, including `state` and a `message`.
       
      .lf.a2a.v1.TaskStatus status = 3 [(.google.api.field_behavior) = REQUIRED];
    • setStatus

      public Task.Builder setStatus(TaskStatus.Builder builderForValue)
       The current status of a `Task`, including `state` and a `message`.
       
      .lf.a2a.v1.TaskStatus status = 3 [(.google.api.field_behavior) = REQUIRED];
    • mergeStatus

      public Task.Builder mergeStatus(TaskStatus value)
       The current status of a `Task`, including `state` and a `message`.
       
      .lf.a2a.v1.TaskStatus status = 3 [(.google.api.field_behavior) = REQUIRED];
    • clearStatus

      public Task.Builder clearStatus()
       The current status of a `Task`, including `state` and a `message`.
       
      .lf.a2a.v1.TaskStatus status = 3 [(.google.api.field_behavior) = REQUIRED];
    • getStatusBuilder

      public TaskStatus.Builder getStatusBuilder()
       The current status of a `Task`, including `state` and a `message`.
       
      .lf.a2a.v1.TaskStatus status = 3 [(.google.api.field_behavior) = REQUIRED];
    • getStatusOrBuilder

      public TaskStatusOrBuilder getStatusOrBuilder()
       The current status of a `Task`, including `state` and a `message`.
       
      .lf.a2a.v1.TaskStatus status = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getStatusOrBuilder in interface TaskOrBuilder
    • getArtifactsList

      public List<Artifact> getArtifactsList()
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
      Specified by:
      getArtifactsList in interface TaskOrBuilder
    • getArtifactsCount

      public int getArtifactsCount()
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
      Specified by:
      getArtifactsCount in interface TaskOrBuilder
    • getArtifacts

      public Artifact getArtifacts(int index)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
      Specified by:
      getArtifacts in interface TaskOrBuilder
    • setArtifacts

      public Task.Builder setArtifacts(int index, Artifact value)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • setArtifacts

      public Task.Builder setArtifacts(int index, Artifact.Builder builderForValue)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • addArtifacts

      public Task.Builder addArtifacts(Artifact value)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • addArtifacts

      public Task.Builder addArtifacts(int index, Artifact value)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • addArtifacts

      public Task.Builder addArtifacts(Artifact.Builder builderForValue)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • addArtifacts

      public Task.Builder addArtifacts(int index, Artifact.Builder builderForValue)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • addAllArtifacts

      public Task.Builder addAllArtifacts(Iterable<? extends Artifact> values)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • clearArtifacts

      public Task.Builder clearArtifacts()
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • removeArtifacts

      public Task.Builder removeArtifacts(int index)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • getArtifactsBuilder

      public Artifact.Builder getArtifactsBuilder(int index)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • getArtifactsOrBuilder

      public ArtifactOrBuilder getArtifactsOrBuilder(int index)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
      Specified by:
      getArtifactsOrBuilder in interface TaskOrBuilder
    • getArtifactsOrBuilderList

      public List<? extends ArtifactOrBuilder> getArtifactsOrBuilderList()
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
      Specified by:
      getArtifactsOrBuilderList in interface TaskOrBuilder
    • addArtifactsBuilder

      public Artifact.Builder addArtifactsBuilder()
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • addArtifactsBuilder

      public Artifact.Builder addArtifactsBuilder(int index)
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • getArtifactsBuilderList

      public List<Artifact.Builder> getArtifactsBuilderList()
       A set of output artifacts for a `Task`.
       
      repeated .lf.a2a.v1.Artifact artifacts = 4;
    • getHistoryList

      public List<Message> getHistoryList()
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
      Specified by:
      getHistoryList in interface TaskOrBuilder
    • getHistoryCount

      public int getHistoryCount()
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
      Specified by:
      getHistoryCount in interface TaskOrBuilder
    • getHistory

      public Message getHistory(int index)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
      Specified by:
      getHistory in interface TaskOrBuilder
    • setHistory

      public Task.Builder setHistory(int index, Message value)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • setHistory

      public Task.Builder setHistory(int index, Message.Builder builderForValue)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • addHistory

      public Task.Builder addHistory(Message value)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • addHistory

      public Task.Builder addHistory(int index, Message value)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • addHistory

      public Task.Builder addHistory(Message.Builder builderForValue)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • addHistory

      public Task.Builder addHistory(int index, Message.Builder builderForValue)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • addAllHistory

      public Task.Builder addAllHistory(Iterable<? extends Message> values)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • clearHistory

      public Task.Builder clearHistory()
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • removeHistory

      public Task.Builder removeHistory(int index)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • getHistoryBuilder

      public Message.Builder getHistoryBuilder(int index)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • getHistoryOrBuilder

      public MessageOrBuilder getHistoryOrBuilder(int index)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
      Specified by:
      getHistoryOrBuilder in interface TaskOrBuilder
    • getHistoryOrBuilderList

      public List<? extends MessageOrBuilder> getHistoryOrBuilderList()
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
      Specified by:
      getHistoryOrBuilderList in interface TaskOrBuilder
    • addHistoryBuilder

      public Message.Builder addHistoryBuilder()
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • addHistoryBuilder

      public Message.Builder addHistoryBuilder(int index)
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • getHistoryBuilderList

      public List<Message.Builder> getHistoryBuilderList()
       protolint:disable REPEATED_FIELD_NAMES_PLURALIZED
       The history of interactions from a `Task`.
       
      repeated .lf.a2a.v1.Message history = 5;
    • hasMetadata

      public boolean hasMetadata()
       protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
       A key/value object to store custom metadata about a task.
       
      .google.protobuf.Struct metadata = 6;
      Specified by:
      hasMetadata in interface TaskOrBuilder
      Returns:
      Whether the metadata field is set.
    • getMetadata

      public com.google.protobuf.Struct getMetadata()
       protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
       A key/value object to store custom metadata about a task.
       
      .google.protobuf.Struct metadata = 6;
      Specified by:
      getMetadata in interface TaskOrBuilder
      Returns:
      The metadata.
    • setMetadata

      public Task.Builder setMetadata(com.google.protobuf.Struct value)
       protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
       A key/value object to store custom metadata about a task.
       
      .google.protobuf.Struct metadata = 6;
    • setMetadata

      public Task.Builder setMetadata(com.google.protobuf.Struct.Builder builderForValue)
       protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
       A key/value object to store custom metadata about a task.
       
      .google.protobuf.Struct metadata = 6;
    • mergeMetadata

      public Task.Builder mergeMetadata(com.google.protobuf.Struct value)
       protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
       A key/value object to store custom metadata about a task.
       
      .google.protobuf.Struct metadata = 6;
    • clearMetadata

      public Task.Builder clearMetadata()
       protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
       A key/value object to store custom metadata about a task.
       
      .google.protobuf.Struct metadata = 6;
    • getMetadataBuilder

      public com.google.protobuf.Struct.Builder getMetadataBuilder()
       protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
       A key/value object to store custom metadata about a task.
       
      .google.protobuf.Struct metadata = 6;
    • getMetadataOrBuilder

      public com.google.protobuf.StructOrBuilder getMetadataOrBuilder()
       protolint:enable REPEATED_FIELD_NAMES_PLURALIZED
       A key/value object to store custom metadata about a task.
       
      .google.protobuf.Struct metadata = 6;
      Specified by:
      getMetadataOrBuilder in interface TaskOrBuilder