Record Class TaskAttachment

Object
Record
akka.javasdk.agent.task.TaskAttachment

public record TaskAttachment(String type, URI uri, String text, String detailLevel, String mimeType) extends Record
A serializable reference to content attached to a task. Stores type metadata and either a URI or inline text so that content references survive event sourcing. Reconstructed to MessageContent at execution time.
  • Constructor Details

    • TaskAttachment

      public TaskAttachment(String type, URI uri, String text, String detailLevel, String mimeType)
      Creates an instance of a TaskAttachment record class.
      Parameters:
      type - the value for the type record component
      uri - the value for the uri record component
      text - the value for the text record component
      detailLevel - the value for the detailLevel record component
      mimeType - the value for the mimeType record component
  • Method Details

    • fromMessageContent

      public static TaskAttachment fromMessageContent(MessageContent content)
      Convert a MessageContent to a serializable TaskAttachment.
    • toMessageContent

      public MessageContent toMessageContent()
      Reconstruct the MessageContent from this reference.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • uri

      public URI uri()
      Returns the value of the uri record component.
      Returns:
      the value of the uri record component
    • text

      public String text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • detailLevel

      public String detailLevel()
      Returns the value of the detailLevel record component.
      Returns:
      the value of the detailLevel record component
    • mimeType

      public String mimeType()
      Returns the value of the mimeType record component.
      Returns:
      the value of the mimeType record component