Record Class UploadToolUtils.ImageSource

java.lang.Object
java.lang.Record
io.meeds.mcp.server.tool.util.UploadToolUtils.ImageSource
Record Components:
imageUrl - the public http(s) URL, or null
imageBase64 - the base64 bytes, or null
attachmentObjectType - the type of the object holding the attachment, or null
attachmentObjectId - the id of the object holding the attachment, or null
uploadId - the upload id of a file the user uploaded, or null
Enclosing class:
UploadToolUtils

public static record UploadToolUtils.ImageSource(String imageUrl, String imageBase64, String attachmentObjectType, String attachmentObjectId, String uploadId) extends Record
The mutually exclusive ways to provide an image to UploadToolUtils.resolveImage(AttachmentService, FileService, Identity, UploadToolUtils.ImageSource, long): a public http(s) URL, base64-encoded bytes, a reference to an existing platform attachment (attachmentObjectType + attachmentObjectId), or the id of a file the user sent through an upload link (uploadId, see UploadService.createUploadToken(String, String, long)).
  • Constructor Details

    • ImageSource

      public ImageSource(String imageUrl, String imageBase64, String attachmentObjectType, String attachmentObjectId)
      A source without an upload id, the shape the add-ons' image tools build.
      Parameters:
      imageUrl - the public http(s) URL, or null
      imageBase64 - the base64 bytes, or null
      attachmentObjectType - the type of the object holding the attachment, or null
      attachmentObjectId - the id of the object holding the attachment, or null
    • ImageSource

      public ImageSource(String imageUrl, String imageBase64, String attachmentObjectType, String attachmentObjectId, String uploadId)
      Creates an instance of a ImageSource record class.
      Parameters:
      imageUrl - the value for the imageUrl record component
      imageBase64 - the value for the imageBase64 record component
      attachmentObjectType - the value for the attachmentObjectType record component
      attachmentObjectId - the value for the attachmentObjectId record component
      uploadId - the value for the uploadId record component
  • Method Details

    • 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.
    • imageUrl

      public String imageUrl()
      Returns the value of the imageUrl record component.
      Returns:
      the value of the imageUrl record component
    • imageBase64

      public String imageBase64()
      Returns the value of the imageBase64 record component.
      Returns:
      the value of the imageBase64 record component
    • attachmentObjectType

      public String attachmentObjectType()
      Returns the value of the attachmentObjectType record component.
      Returns:
      the value of the attachmentObjectType record component
    • attachmentObjectId

      public String attachmentObjectId()
      Returns the value of the attachmentObjectId record component.
      Returns:
      the value of the attachmentObjectId record component
    • uploadId

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