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 TypeMethodDescriptionvoid
addCertification
(String cert) Adds a Flight Academy Certification to this Resource.void
addCertifications
(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.int
Returns 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.int
getHits()
Returns the number of times this Resource has been visited.boolean
Returns whether this Resource should be shown to users not enrolled in the Flight Academy Certifications.int
Returns the last updater of this Resource.boolean
Returns 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.int
hashCode()
void
setAuthorID
(int id) Updates the author of this bean.void
setCategory
(String cat) Updates the category of this Resource.void
setCreatedOn
(Instant dt) Updates the creation date of this Resource.void
setDescription
(String desc) Updates the description of this Resource.void
setHits
(int hits) Updates the number of times this Resource has been visited.void
setIgnoreCertifcations
(boolean ignoreCerts) Marks this Resource as visible to users not enrolled in the specified Flight Academy Certifications.void
setLastUpdateID
(int id) Updates the last modifier of this Resource.void
setPublic
(boolean isPublic) Updates whether this Resource is available to the public.void
Updates the title of the Resource.void
Updates the URL of this Resource.toString()
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, setID, validateID, validateID
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:ExternalURL
Returns the URL.- Specified by:
getURL
in interfaceExternalURL
- Returns:
- the URL
-
getTitle
Description copied from interface:ExternalURL
Returns the URL Title.- Specified by:
getTitle
in interfaceExternalURL
- Returns:
- the title
-
getDomain
-
getCategory
-
getAuthorID
public int getAuthorID()Returns the Author of this Resource.- Specified by:
getAuthorID
in 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:AuthoredBean
Updates the author of this bean.- Specified by:
setAuthorID
in 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:Auditable
Returns the object ID for this auditable object.- Specified by:
getAuditID
in interfaceAuditable
- Returns:
- the ID
-
toString
-
hashCode
public int hashCode()- Overrides:
hashCode
in classDatabaseBean
-
getRowClassName
Description copied from interface:ViewEntry
Returns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- the CSS class name, or NULL if none
-