Class Resource

java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.fleet.Resource
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Object>, Auditable, AuthoredBean, ExternalURL, IDBean, ViewEntry, Cacheable

public class Resource extends DatabaseBean implements ViewEntry, AuthoredBean, Auditable, ExternalURL
A bean to store Web Resource link data.
Since:
1.0
Version:
10.6
Author:
Luke
See Also:
  • Constructor Details

  • Method Details

    • getURL

      public String getURL()
      Description copied from interface: ExternalURL
      Returns the URL.
      Specified by:
      getURL in interface ExternalURL
      Returns:
      the URL
    • getTitle

      public String getTitle()
      Description copied from interface: ExternalURL
      Returns the URL Title.
      Specified by:
      getTitle in interface ExternalURL
      Returns:
      the title
    • getDomain

      public String getDomain()
      Retruns the Resource URL domain.
      Returns:
      the domain
      See Also:
    • getCategory

      public String getCategory()
      Returns the Resource category.
      Returns:
      the category
      See Also:
    • getAuthorID

      public int getAuthorID()
      Returns the Author of this Resource.
      Specified by:
      getAuthorID in interface AuthoredBean
      Returns:
      the Author's database ID
      See Also:
    • getLastUpdateID

      public int getLastUpdateID()
      Returns the last updater of this Resource.
      Returns:
      the Updater's database ID
      See Also:
    • getCreatedOn

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

      public int getHits()
      Returns the number of times this Resource has been visited.
      Returns:
      the number of hits
      See Also:
    • getDescription

      public String getDescription()
      Returns the description of this Resource.
      Returns:
      the description
      See Also:
    • getPublic

      public boolean getPublic()
      Returns whether this Resource is available to the public.
      Returns:
      TRUE if all users can see this Resource, otherwise FALSE
      See Also:
    • getIgnoreCertifications

      public boolean getIgnoreCertifications()
      Returns whether this Resource should be shown to users not enrolled in the Flight Academy Certifications.
      Returns:
      TRUE if visible to all, otherwise FALSE
      See Also:
    • getCertifications

      public Collection<String> getCertifications()
      Returns all Certifications linked to this Resource.
      Returns:
      a Collection of Certification names
      See Also:
    • setURL

      public void setURL(String url)
      Updates the URL of this Resource.
      Parameters:
      url - the URL
      Throws:
      IllegalArgumentException - if the URL is invalid
      See Also:
    • setTitle

      public void setTitle(String title)
      Updates the title of the Resource.
      Parameters:
      title - the title
      See Also:
    • setDescription

      public void setDescription(String desc)
      Updates the description of this Resource.
      Parameters:
      desc - the description
      See Also:
    • setCategory

      public void setCategory(String cat)
      Updates the category of this Resource.
      Parameters:
      cat - the category
      See Also:
    • addCertification

      public void addCertification(String cert)
      Adds a Flight Academy Certification to this Resource.
      Parameters:
      cert - the Certification name
      See Also:
    • addCertifications

      public void addCertifications(Collection<String> certs)
      Clears the list of Flight Academy Certifications and replaces it with a new list.
      Parameters:
      certs - a Collection of Certification names
      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:
    • setLastUpdateID

      public void setLastUpdateID(int id)
      Updates the last modifier of this Resource.
      Parameters:
      id - the Updater's database ID
      Throws:
      IllegalArgumentException - if id is zero or negative
      See Also:
    • setCreatedOn

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

      public void setHits(int hits)
      Updates the number of times this Resource has been visited.
      Parameters:
      hits - the number of hits
      See Also:
    • setPublic

      public void setPublic(boolean isPublic)
      Updates whether this Resource is available to the public.
      Parameters:
      isPublic - TRUE if all users can see this Resource, otherwise FALSE
      See Also:
    • setIgnoreCertifcations

      public void setIgnoreCertifcations(boolean ignoreCerts)
      Marks this Resource as visible to users not enrolled in the specified Flight Academy Certifications.
      Parameters:
      ignoreCerts - TRUE if visible to all users, otherwise FALSE
      See Also:
    • getAuditID

      public String getAuditID()
      Description copied from interface: Auditable
      Returns the object ID for this auditable object.
      Specified by:
      getAuditID in interface Auditable
      Returns:
      the ID
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class DatabaseBean
    • getRowClassName

      public String getRowClassName()
      Description copied from interface: ViewEntry
      Returns the CSS class for this object if rendered in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name, or NULL if none