Class AbstractComment
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.DatabaseBlobBean
org.deltava.beans.AbstractComment
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,AuthoredBean
,IDBean
,Cacheable
- Direct Known Subclasses:
CourseComment
,IssueComment
,IssueComment
A bean to store comments with attachments.
- Since:
- 9.0
- Version:
- 9.0
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class org.deltava.beans.DatabaseBlobBean
_buffer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
Returns the Author of this bean.getBody()
Returns the body text of this Comment.byte[]
Returns the file buffer.Returns the creation date of this Comment.Returns the file extension.getName()
Returns the name of the attachment.int
Returns the parent record's database ID.int
getSize()
Returns the size of the attachment.void
setAuthorID
(int id) Updates the author of this bean.void
Updates the body text of this Comment.void
setCreatedOn
(Instant dt) Updates the creation date of this Comment.void
Updates the name of the attachment.void
setParentID
(int id) Updates the ID of the parent record.void
setSize
(int size) Updates the size of the attachment.Methods inherited from class org.deltava.beans.DatabaseBlobBean
clear, getInputStream, isLoaded, load, load
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, equals, getHexID, getID, hashCode, setID, validateID, validateID
-
Constructor Details
-
AbstractComment
public AbstractComment()
-
-
Method Details
-
getBody
-
getSize
public int getSize()Returns the size of the attachment.- Overrides:
getSize
in classDatabaseBlobBean
- Returns:
- the size in bytes
- See Also:
-
getBuffer
public byte[] getBuffer()Returns the file buffer.- Returns:
- the buffer
- Throws:
IllegalStateException
- if not loaded
-
getExtension
Returns the file extension.- Returns:
- the extension, or the file name if none
-
getName
-
getAuthorID
public int getAuthorID()Description copied from interface:AuthoredBean
Returns the Author of this bean.- Specified by:
getAuthorID
in interfaceAuthoredBean
- Returns:
- the author's database ID
- See Also:
-
getParentID
public int getParentID()Returns the parent record's database ID.- Returns:
- the ID
- See Also:
-
getCreatedOn
Returns the creation date of this Comment.- Returns:
- the date/time the Comment was created
- See Also:
-
setCreatedOn
Updates the creation date of this Comment.- Parameters:
dt
- the date/time the Comment was created- See Also:
-
setBody
Updates the body text of this Comment.- Parameters:
body
- the body text- See Also:
-
setName
Updates the name of the attachment.- Parameters:
name
- the file name- See Also:
-
setSize
public void setSize(int size) Updates the size of the attachment.- Parameters:
size
- the size in bytes- Throws:
IllegalArgumentException
- if the attachment has been loaded- See Also:
-
setAuthorID
public void setAuthorID(int id) Description copied from interface:AuthoredBean
Updates the author of this bean.- Specified by:
setAuthorID
in interfaceAuthoredBean
- Parameters:
id
- the author's database ID.- See Also:
-
setParentID
public void setParentID(int id) Updates the ID of the parent record.- Parameters:
id
- the parent's database record- See Also:
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Object>
- Overrides:
compareTo
in classDatabaseBean
-