Comment

class Comment

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

Constructors

Comment
Link copied to clipboard
fun Comment()
Creates a comment.
Comment
Link copied to clipboard
fun Comment(userId: String, postId: String, profilePicture: String, username: String, commentBody: String)
Creates a comment given the unique identifier of the post to which the comment is tied, the comment itself, and the unique identifier, profile picture, and username of the user who posted it.

Properties

commentBody
Link copied to clipboard
private var commentBody: String? = null
Comment per se.
commentId
Link copied to clipboard
private var commentId: String? = null
Unique identifier of the comment.
dateCommented
Link copied to clipboard
private var dateCommented: String? = null
Date when the comment was posted.
editable
Link copied to clipboard
private var editable: Boolean = false
true if the comment can be edited by the user; false, otherwise
postId
Link copied to clipboard
private var postId: String? = null
Unique identifier of the post to which the comment is tied.
profilePicture
Link copied to clipboard
private var profilePicture: String? = null
URI of the profile picture of the user who posted the comment.
userId
Link copied to clipboard
private var userId: String? = null
Unique identifier of the user who posted the comment.
username
Link copied to clipboard
private var username: String? = null
Username of the user who posted the comment.

Functions

getCommentBody
Link copied to clipboard
fun getCommentBody(): String?
Returns the comment per se.
getCommentId
Link copied to clipboard
fun getCommentId(): String?
Returns the unique identifier of the comment.
getDateCommented
Link copied to clipboard
fun getDateCommented(): String?
Returns the date when the comment was posted.
getEditable
Link copied to clipboard
fun getEditable(): Boolean
Returns true if the user is allowed to edit the comment; false, otherwise.
getPostId
Link copied to clipboard
fun getPostId(): String?
Returns the unique identifier of the post to which the comment is tied.
getProfilePicture
Link copied to clipboard
fun getProfilePicture(): String?
Returns the profile picture of the user who posted the comment.
getUserId
Link copied to clipboard
fun getUserId(): String?
Returns the unique identifier of the user who posted the comment.
getUsername
Link copied to clipboard
fun getUsername(): String?
Returns the username of the user who posted the comment.
setCommentBody
Link copied to clipboard
fun setCommentBody(commentBody: String?)
Sets the comment per se to the specified string.
setCommentId
Link copied to clipboard
fun setCommentId(commentId: String?)
Sets the unique identifier of the comment to the specified string.
setDateCommented
Link copied to clipboard
fun setDateCommented(dateCommented: String?)
Sets the date when the comment was posted to the specified string.
setEditable
Link copied to clipboard
fun setEditable(editable: Boolean)
Allows the user to edit a comment posted by them but disallows them to edit a comment created by another user.
setPostId
Link copied to clipboard
fun setPostId(postId: String?)
Sets the unique identifier of the post to which the comment is tied to the specified string.
setProfilePicture
Link copied to clipboard
fun setProfilePicture(profPic: String?)
Sets the profile picture of the user who posted the comment to the photo specified by the given URI.
setUserId
Link copied to clipboard
fun setUserId(userId: String?)
Sets the unique identifier of the user who posted the comment to the specified string.
setUsername
Link copied to clipboard
fun setUsername(username: String?)
Sets the username of the user who posted the comment to the specified string.