Record Class UploadToolUtils.ImageSource

java.lang.Object
java.lang.Record
io.meeds.mcp.server.tool.util.UploadToolUtils.ImageSource
Enclosing class:
UploadToolUtils

public static record UploadToolUtils.ImageSource(String imageUrl, String imageBase64, String attachmentObjectType, String attachmentObjectId) extends Record
The three mutually-exclusive ways to provide an image to UploadToolUtils.resolveImage(org.exoplatform.social.attachment.AttachmentService, org.exoplatform.commons.file.services.FileService, org.exoplatform.services.security.Identity, io.meeds.mcp.server.tool.util.UploadToolUtils.ImageSource, long): a public http(s) URL, base64-encoded bytes, or a reference to an existing platform attachment (attachmentObjectType + attachmentObjectId).
  • Constructor Details

    • ImageSource

      public ImageSource(String imageUrl, String imageBase64, String attachmentObjectType, String attachmentObjectId)
      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
  • 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