Class News

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

public class News extends ImageBean implements AuthoredBean
A class for storing System News entries.
Since:
1.0
Version:
10.6
Author:
Luke
See Also:
  • Constructor Details

    • News

      public News(String sbj, String body)
      Create a new System News entry object, with the Date defaulting to the current date/time
      Parameters:
      sbj - This entry's title
      body - This entry's content
      Throws:
      NullPointerException - if sbj is null
  • Method Details

    • getDate

      public Instant getDate()
      Return the date/entry this entry was created.
      Returns:
      The date/time this System News entry was created
    • getSubject

      public String getSubject()
      Return this entry's Title.
      Returns:
      The Title of this System News entry
      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:
    • getImageType

      public ImageType getImageType()
      Description copied from class: ImageBean
      Returns the database image type.
      Specified by:
      getImageType in class ImageBean
      Returns:
      an ImageType
    • getBannerWidth

      public int getBannerWidth()
      Returns the width of the banner image.
      Returns:
      the width as a percentage of its parent container
      See Also:
    • getBody

      public String getBody()
      Return this entry's Content.
      Returns:
      The Content of this System News entry
      See Also:
    • getIsHTML

      public boolean getIsHTML()
      Returns if this entry is raw HTML.
      Returns:
      TRUE if the entry is raw HTML, otherwise FALSE
      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:
    • setDate

      public void setDate(Instant d)
      Update the date of this entry.
      Parameters:
      d - The new date/time for this System News entry
      See Also:
    • setSubject

      public void setSubject(String subj)
      Updates this subject of this entry.
      Parameters:
      subj - the new subject
      Throws:
      NullPointerException - if subj is null
      See Also:
    • setBody

      public void setBody(String body)
      Updates this entry's body content.
      Parameters:
      body - the new content
      See Also:
    • setBannerWidth

      public void setBannerWidth(int w)
      Updates the width of the banner image.
      Parameters:
      w - the width as a percentage of the parent container
      Throws:
      IllegalStateException - if no banner image is present
    • setIsHTML

      public void setIsHTML(boolean html)
      Updates if this entry is raw HTML.
      Parameters:
      html - TRUE if raw HTML text, otherwise FALSE
      See Also:
    • compareTo

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