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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCertification(String cert) Adds a Flight Academy Certification to this Resource.voidaddCertifications(Collection<String> certs) Clears the list of Flight Academy Certifications and replaces it with a new list.Returns the object ID for this auditable object.intReturns the Author of this Resource.Returns the Resource category.Returns all Certifications linked to this Resource.Returns the creation date of this Resource.Returns the description of this Resource.Retruns the Resource URL domain.intgetHits()Returns the number of times this Resource has been visited.booleanReturns whether this Resource should be shown to users not enrolled in the Flight Academy Certifications.intReturns the last updater of this Resource.booleanReturns whether this Resource is available to the public.Returns the CSS class for this object if rendered in a view table.getTitle()Returns the URL Title.getURL()Returns the URL.inthashCode()voidsetAuthorID(int id) Updates the author of this bean.voidsetCategory(String cat) Updates the category of this Resource.voidsetCreatedOn(Instant dt) Updates the creation date of this Resource.voidsetDescription(String desc) Updates the description of this Resource.voidsetHits(int hits) Updates the number of times this Resource has been visited.voidsetIgnoreCertifcations(boolean ignoreCerts) Marks this Resource as visible to users not enrolled in the specified Flight Academy Certifications.voidsetLastUpdateID(int id) Updates the last modifier of this Resource.voidsetPublic(boolean isPublic) Updates whether this Resource is available to the public.voidUpdates the title of the Resource.voidUpdates the URL of this Resource.toString()Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, setID, validateID, validateIDMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.deltava.beans.Auditable
getAuditType, isCrossApp
-
Constructor Details
-
Resource
Creates a new Web Resource bean.- Parameters:
url- the URL of the resource- Throws:
IllegalArgumentException- if the URL is invalid- See Also:
-
-
Method Details
-
getURL
Description copied from interface:ExternalURLReturns the URL.- Specified by:
getURLin interfaceExternalURL- Returns:
- the URL
-
getTitle
Description copied from interface:ExternalURLReturns the URL Title.- Specified by:
getTitlein interfaceExternalURL- Returns:
- the title
-
getDomain
-
getCategory
-
getAuthorID
public int getAuthorID()Returns the Author of this Resource.- Specified by:
getAuthorIDin interfaceAuthoredBean- 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
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
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
Returns all Certifications linked to this Resource.- Returns:
- a Collection of Certification names
- See Also:
-
setURL
Updates the URL of this Resource.- Parameters:
url- the URL- Throws:
IllegalArgumentException- if the URL is invalid- See Also:
-
setTitle
Updates the title of the Resource.- Parameters:
title- the title- See Also:
-
setDescription
Updates the description of this Resource.- Parameters:
desc- the description- See Also:
-
setCategory
Updates the category of this Resource.- Parameters:
cat- the category- See Also:
-
addCertification
Adds a Flight Academy Certification to this Resource.- Parameters:
cert- the Certification name- See Also:
-
addCertifications
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:AuthoredBeanUpdates the author of this bean.- Specified by:
setAuthorIDin interfaceAuthoredBean- 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
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
Description copied from interface:AuditableReturns the object ID for this auditable object.- Specified by:
getAuditIDin interfaceAuditable- Returns:
- the ID
-
toString
-
hashCode
public int hashCode()- Overrides:
hashCodein classDatabaseBean
-
getRowClassName
Description copied from interface:ViewEntryReturns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassNamein interfaceViewEntry- Returns:
- the CSS class name, or NULL if none
-