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 nullimageBase64- the base64 bytes, or nullattachmentObjectType- the type of the object holding the attachment, or nullattachmentObjectId- the id of the object holding the attachment, or nulluploadId- 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 Summary
ConstructorsConstructorDescriptionImageSource(String imageUrl, String imageBase64, String attachmentObjectType, String attachmentObjectId) A source without an upload id, the shape the add-ons' image tools build.ImageSource(String imageUrl, String imageBase64, String attachmentObjectType, String attachmentObjectId, String uploadId) Creates an instance of aImageSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattachmentObjectIdrecord component.Returns the value of theattachmentObjectTyperecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theimageBase64record component.imageUrl()Returns the value of theimageUrlrecord component.final StringtoString()Returns a string representation of this record class.uploadId()Returns the value of theuploadIdrecord component.
-
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 nullimageBase64- the base64 bytes, or nullattachmentObjectType- the type of the object holding the attachment, or nullattachmentObjectId- 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 aImageSourcerecord class.- Parameters:
imageUrl- the value for theimageUrlrecord componentimageBase64- the value for theimageBase64record componentattachmentObjectType- the value for theattachmentObjectTyperecord componentattachmentObjectId- the value for theattachmentObjectIdrecord componentuploadId- the value for theuploadIdrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
imageUrl
-
imageBase64
Returns the value of theimageBase64record component.- Returns:
- the value of the
imageBase64record component
-
attachmentObjectType
Returns the value of theattachmentObjectTyperecord component.- Returns:
- the value of the
attachmentObjectTyperecord component
-
attachmentObjectId
Returns the value of theattachmentObjectIdrecord component.- Returns:
- the value of the
attachmentObjectIdrecord component
-
uploadId
-