Class AbstractComment

All Implemented Interfaces:
Serializable, Comparable<Object>, AuthoredBean, IDBean, Cacheable
Direct Known Subclasses:
CourseComment, IssueComment, IssueComment

public abstract class AbstractComment extends DatabaseBlobBean implements AuthoredBean
A bean to store comments with attachments.
Since:
9.0
Version:
9.0
Author:
Luke
See Also:
  • Constructor Details

    • AbstractComment

      public AbstractComment()
  • Method Details

    • getBody

      public String getBody()
      Returns the body text of this Comment.
      Returns:
      the Comment text
      See Also:
    • getSize

      public int getSize()
      Returns the size of the attachment.
      Overrides:
      getSize in class DatabaseBlobBean
      Returns:
      the size in bytes
      See Also:
    • getBuffer

      public byte[] getBuffer()
      Returns the file buffer.
      Returns:
      the buffer
      Throws:
      IllegalStateException - if not loaded
    • getExtension

      public String getExtension()
      Returns the file extension.
      Returns:
      the extension, or the file name if none
    • getName

      public String getName()
      Returns the name of the attachment.
      Returns:
      the file name
      See Also:
    • getAuthorID

      public int getAuthorID()
      Description copied from interface: AuthoredBean
      Returns the Author of this bean.
      Specified by:
      getAuthorID in interface AuthoredBean
      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

      public Instant getCreatedOn()
      Returns the creation date of this Comment.
      Returns:
      the date/time the Comment was created
      See Also:
    • setCreatedOn

      public void setCreatedOn(Instant dt)
      Updates the creation date of this Comment.
      Parameters:
      dt - the date/time the Comment was created
      See Also:
    • setBody

      public void setBody(String body)
      Updates the body text of this Comment.
      Parameters:
      body - the body text
      See Also:
    • setName

      public void setName(String name)
      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 interface AuthoredBean
      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

      public int compareTo(Object o)
      Specified by:
      compareTo in interface Comparable<Object>
      Overrides:
      compareTo in class DatabaseBean