Post

class Post

Class representing a post and specifying the attributes associated with it.

Constructors

Post
Link copied to clipboard
fun Post()
Creates a post.
Post
Link copied to clipboard
fun Post(userId: String, postId: String, title: String, postImg: String, medium: String, dimensions: String, description: String, tags: ArrayList<String>)
Creates a post given the unique identifier of the user who posted the post, the unique identifier of the post itself, the title of the post, the artwork to be posted, the medium of the artwork, the dimensions of the artwork, the description of the post, and the tags of the post.

Properties

bookmark
Link copied to clipboard
private var bookmark: Boolean = false
true if the current user has bookmarked the post; false, otherwise.
bookmarkUsers
Link copied to clipboard
private var bookmarkUsers: HashMap<String, Any?>
List of users that have bookmarked the post.
comments
Link copied to clipboard
private var comments: HashMap<String, Any?>
List of comments on the post.
datePosted
Link copied to clipboard
private var datePosted: String? = null
Date the post was posted.
description
Link copied to clipboard
private var description: String? = null
Description of the post.
dimensions
Link copied to clipboard
private var dimensions: String? = null
Dimensions of the posted artwork.
highlight
Link copied to clipboard
private var highlight: Boolean = false
true if the current user has highlighted the post; false, otherwise.
highlightUser
Link copied to clipboard
private var highlightUser: String? = null
Unique identifier of the user who highlighted the post.
medium
Link copied to clipboard
private var medium: String? = null
Medium of the posted artwork.
numComments
Link copied to clipboard
private var numComments: Int = 0
Number of comments of the post.
numUpvotes
Link copied to clipboard
private var numUpvotes: Int = 0
Number of upvotes of the post.
postId
Link copied to clipboard
private var postId: String? = null
Unique identifier of the post.
postImg
Link copied to clipboard
private var postImg: String? = null
Image of the post (i.e., the artwork itself).
profilePicture
Link copied to clipboard
private var profilePicture: String? = null
Profile picture of the user who posted the post.
tags
Link copied to clipboard
private var tags: ArrayList<String>
List of tags of the post.
title
Link copied to clipboard
private var title: String? = null
Title of the post.
upvote
Link copied to clipboard
private var upvote: Boolean = false
true if the current user has upvoted the post; false, otherwise.
upvoteUsers
Link copied to clipboard
private var upvoteUsers: HashMap<String, Any?>
List of users that have upvoted the post.
userId
Link copied to clipboard
private var userId: String? = null
Unique identifier of the user who posted the post.
username
Link copied to clipboard
private var username: String? = null
Username of the user who posted the post.

Functions

getBookmark
Link copied to clipboard
fun getBookmark(): Boolean
Returns true if the user has bookmarked the post and false otherwise.
getBookmarkUsers
Link copied to clipboard
fun getBookmarkUsers(): HashMap<String, Any?>
Returns the list of users that have bookmarked the post.
getComments
Link copied to clipboard
fun getComments(): HashMap<String, Any?>
Returns the comments tied to the post.
getDatePosted
Link copied to clipboard
fun getDatePosted(): String?
Returns the date the post was posted.
getDescription
Link copied to clipboard
fun getDescription(): String?
Returns the description of the post.
getDimensions
Link copied to clipboard
fun getDimensions(): String?
Returns the dimensions of the artwork.
getHighlight
Link copied to clipboard
fun getHighlight(): Boolean
Returns true if the user has highlighted the post and false otherwise.
getHighlightUser
Link copied to clipboard
fun getHighlightUser(): String?
Returns the unique identifier of the user who highlighted the post, if any.
getMedium
Link copied to clipboard
fun getMedium(): String?
Returns the medium of the artwork.
getNumComments
Link copied to clipboard
fun getNumComments(): Int
Returns the number of comments of the post.
getNumUpvotes
Link copied to clipboard
fun getNumUpvotes(): Int
Returns the number of upvotes of the post.
getPostId
Link copied to clipboard
fun getPostId(): String?
Returns the unique identifier of the post.
getPostImg
Link copied to clipboard
fun getPostImg(): String?
Returns the artwork associated with the post.
getProfilePicture
Link copied to clipboard
fun getProfilePicture(): String?
Returns the profile picture of the user who posted the post.
getTags
Link copied to clipboard
fun getTags(): ArrayList<String>?
Returns the tags of the post.
getTitle
Link copied to clipboard
fun getTitle(): String?
Returns the title of the post.
getUpvote
Link copied to clipboard
fun getUpvote(): Boolean
Returns true if the user has upvoted the post and false otherwise.
getUpvoteUsers
Link copied to clipboard
fun getUpvoteUsers(): HashMap<String, Any?>
Returns the list of users that have upvoted the post.
getUserId
Link copied to clipboard
fun getUserId(): String?
Returns the unique identifier of the user who posted the post.
getUsername
Link copied to clipboard
fun getUsername(): String?
Returns the username of the user who posted the post.
setBookmark
Link copied to clipboard
fun setBookmark(bookmark: Boolean)
Sets the bookmark status of the post to the specified boolean value.
setBookmarkUsers
Link copied to clipboard
fun setBookmarkUsers(bookmarkUsers: HashMap<String, Any?>)
Sets the list of users who bookmarked the post to the specified hashmap.
setComments
Link copied to clipboard
fun setComments(comments: HashMap<String, Any?>)
Sets the list of comments tied to the post to the specified hashmap.
setDatePosted
Link copied to clipboard
fun setDatePosted(datePosted: String?)
Sets the date that the post was posted to the specified string.
setDescription
Link copied to clipboard
fun setDescription(description: String?)
Sets the description of the post to the specified string.
setDimensions
Link copied to clipboard
fun setDimensions(dimensions: String?)
Sets the dimensions of the posted artwork to the specified string.
setHighlight
Link copied to clipboard
fun setHighlight(highlight: Boolean)
Sets the highlight status of the post to the specified boolean value.
setHighlightUser
Link copied to clipboard
fun setHighlightUser(highlightUser: String?)
Sets the unique identifier of the user who highlighted the post to the specified string.
setMedium
Link copied to clipboard
fun setMedium(medium: String?)
Sets the medium of the posted artwork to the specified string.
setNumComments
Link copied to clipboard
fun setNumComments(numComments: Int)
Sets the number of comments of the post to the specified value.
setNumUpvotes
Link copied to clipboard
fun setNumUpvotes(numUpvotes: Int)
Sets the number of upvotes of the post to the specified value.
setPostId
Link copied to clipboard
fun setPostId(postId: String?)
Sets the unique identifier of the post to the specified string.
setPostImg
Link copied to clipboard
fun setPostImg(postImg: String?)
Sets the image associated with the post (i.e., the artwork) to the specified string.
setProfilePicture
Link copied to clipboard
fun setProfilePicture(picture: String?)
Sets the profile picture associated with the post to the specified string.
setTags
Link copied to clipboard
fun setTags(tags: ArrayList<String>)
Sets the tags of the post to the specified list of strings.
setTitle
Link copied to clipboard
fun setTitle(title: String?)
Sets the title of the post to the specified string.
setUpvote
Link copied to clipboard
fun setUpvote(upvote: Boolean)
Sets the upvote status of the post to the specified boolean value.
setUpvoteUsers
Link copied to clipboard
fun setUpvoteUsers(upvoteUsers: HashMap<String, Any?>)
Sets the list of users who upvoted the post to the specified hashmap.
setUserId
Link copied to clipboard
fun setUserId(userId: String)
Sets the unique identifier of the user who posted the post to the specified string.
setUsername
Link copied to clipboard
fun setUsername(name: String?)
Sets the username associated with the post to the specified string.