Package io.getstream.chat.android.models
Class Attachment
-
- All Implemented Interfaces:
-
io.getstream.chat.android.models.CustomObject
public final class Attachment implements CustomObject
Represents an attachment. Most commonly these are files, images, videos and audio recordings, but the class is flexible enough that it can represent other things as well such as a date, a given location or other things.
If you want to create a custom attachment we suggest you use extraData to store the information you need.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classAttachment.UploadStateRepresents various states in attachment upload lifecycle.
public final classAttachment.Builder
-
Field Summary
Fields Modifier and Type Field Description private final StringauthorNameprivate final StringauthorLinkprivate final StringtitleLinkprivate final StringthumbUrlprivate final StringimageUrlprivate final StringassetUrlprivate final StringogUrlprivate final StringmimeTypeprivate final IntegerfileSizeprivate final Stringtitleprivate final Stringtextprivate final Stringtypeprivate final Stringimageprivate final Stringurlprivate final Stringnameprivate final Stringfallbackprivate final IntegeroriginalHeightprivate final IntegeroriginalWidthprivate final Fileuploadprivate final Attachment.UploadStateuploadStateprivate final Map<String, Object>extraData
-
Constructor Summary
Constructors Constructor Description Attachment(String authorName, String authorLink, String titleLink, String thumbUrl, String imageUrl, String assetUrl, String ogUrl, String mimeType, Integer fileSize, String title, String text, String type, String image, String url, String name, String fallback, Integer originalHeight, Integer originalWidth, File upload, Attachment.UploadState uploadState, Map<String, Object> extraData)
-
Method Summary
Modifier and Type Method Description final StringgetAuthorName()final StringgetAuthorLink()final StringgetTitleLink()final StringgetThumbUrl()final StringgetImageUrl()final StringgetAssetUrl()final StringgetOgUrl()final StringgetMimeType()final IntegergetFileSize()final StringgetTitle()final StringgetText()final StringgetType()final StringgetImage()final StringgetUrl()final StringgetName()final StringgetFallback()final IntegergetOriginalHeight()final IntegergetOriginalWidth()final FilegetUpload()The local file to upload when the attachment is sent. final Attachment.UploadStategetUploadState()Map<String, Object>getExtraData()StringtoString()final Attachment.BuildernewBuilder()-
-
Constructor Detail
-
Attachment
Attachment(String authorName, String authorLink, String titleLink, String thumbUrl, String imageUrl, String assetUrl, String ogUrl, String mimeType, Integer fileSize, String title, String text, String type, String image, String url, String name, String fallback, Integer originalHeight, Integer originalWidth, File upload, Attachment.UploadState uploadState, Map<String, Object> extraData)
- Parameters:
authorName- The name of the site the URL leads to.authorLink- The link to the website.titleLink- The link to the URL or the resource linked.thumbUrl- The URL for the thumbnail version of the attachment, given the attachment has a visual quality, e.g.imageUrl- The URL for the raw version of the attachment.assetUrl- The URL for the asset.ogUrl- The original link that was enriched.mimeType- The mime type of the given attachment.fileSize- The size of the given attachment.title- The title of the attachment.text- The page description.type- The type of the attachment.image- The image attachment.fallback- Alternative description in the case of an image attachment (img alt in HTML).originalHeight- The original height of the attachment.originalWidth- The original width of the attachment.uploadState- The state of the upload, i.e.extraData- Stores various extra information that can be sent when uploading the attachment or read when downloading it.
-
-
Method Detail
-
getAuthorName
final String getAuthorName()
-
getAuthorLink
final String getAuthorLink()
-
getTitleLink
final String getTitleLink()
-
getThumbUrl
final String getThumbUrl()
-
getImageUrl
final String getImageUrl()
-
getAssetUrl
final String getAssetUrl()
-
getMimeType
final String getMimeType()
-
getFileSize
final Integer getFileSize()
-
getFallback
final String getFallback()
-
getOriginalHeight
final Integer getOriginalHeight()
-
getOriginalWidth
final Integer getOriginalWidth()
-
getUpload
final File getUpload()
The local file to upload when the attachment is sent. The url property will be populated with the URL of the uploaded file when done.
Leaving this property empty means that there is no file to upload for this attachment.
-
getUploadState
final Attachment.UploadState getUploadState()
-
getExtraData
Map<String, Object> getExtraData()
-
newBuilder
@SinceKotlin(version = "99999.9") final Attachment.Builder newBuilder()
-
-
-
-