Class Image
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.DatabaseBlobBean
org.deltava.beans.ImageBean
org.deltava.beans.gallery.Image
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,AuthoredBean
,ComboAlias
,IDBean
,Cacheable
A class to store Image Gallery images.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.deltava.beans.ImageBean
ImageBean.ImageFormat
-
Field Summary
Fields inherited from class org.deltava.beans.DatabaseBlobBean
_buffer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLike
(int userID) Adds a like for this image.int
Returns the Author of this bean.Returns the alias to use in the HTML <OPTION> element.Returns the visible name to use in the HTML <OPTION> element.Returns the date this Image was created.Returns a description of the image.boolean
getFleet()
Returns if this image is part of the Fleet Gallery.Returns the database image type.int
Returns the number of Votes cast for this Image.getLikes()
Returns all votes for this image.getName()
Returns the name of the image.int
Returns the database ID of the Water Cooler discussion thread associated with this Gallery Image.boolean
Checks if a particular person has cast a vote for this imagevoid
setAuthorID
(int id) Updates the Author of this Image.void
setCreatedOn
(Instant dt) Updates the date this Image was created.void
setDescription
(String desc) Updates the Image's description.void
setFleet
(boolean fleet) Updates if this image is part of the Fleet Gallery.void
setLikeCount
(int count) Updates the number of Likes for this Image.void
Updates the name of this Image.void
setThreadID
(int id) Updates the Water Cooler discussion thread associated with this Image.Methods inherited from class org.deltava.beans.ImageBean
checkParam, getFormat, getHasImage, getHeight, getSize, getWidth, load, load, setFormat, setHeight, setSize, setWidth
Methods inherited from class org.deltava.beans.DatabaseBlobBean
clear, getInputStream, isLoaded
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, hashCode, setID, validateID, validateID
-
Constructor Details
-
Image
Create a new Image with a particular name.- Parameters:
name
- the name of the Imagedesc
- a description of the Image- Throws:
NullPointerException
- if name or desc are null
-
-
Method Details
-
getName
-
getAuthorID
public int getAuthorID()Description copied from interface:AuthoredBean
Returns the Author of this bean.- Specified by:
getAuthorID
in interfaceAuthoredBean
- Returns:
- the author's database ID
- See Also:
-
getImageType
Description copied from class:ImageBean
Returns the database image type.- Specified by:
getImageType
in classImageBean
- Returns:
- an ImageType
-
getThreadID
public int getThreadID()Returns the database ID of the Water Cooler discussion thread associated with this Gallery Image.- Returns:
- the Database ID of the Thread linked to this Image
- See Also:
-
getDescription
Returns a description of the image.- Returns:
- the image's description
- See Also:
-
getComboName
Description copied from interface:ComboAlias
Returns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboName
in interfaceComboAlias
- Returns:
- The visible name for this entry
-
getComboAlias
Description copied from interface:ComboAlias
Returns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAlias
in interfaceComboAlias
- Returns:
- The alias for this entry
-
getCreatedOn
Returns the date this Image was created.- Returns:
- the date/time this Image was created on
- See Also:
-
getFleet
public boolean getFleet()Returns if this image is part of the Fleet Gallery.- Returns:
- TRUE if the image is in the Fleet Gallery, otherwise FALSE
- See Also:
-
setCreatedOn
Updates the date this Image was created.- Parameters:
dt
- the date/time this Image was created on- See Also:
-
setAuthorID
public void setAuthorID(int id) Updates the Author of this Image.- Specified by:
setAuthorID
in interfaceAuthoredBean
- Parameters:
id
- the Database ID of the author of this Image- Throws:
IllegalArgumentException
- if id is zero or negative- See Also:
-
setThreadID
public void setThreadID(int id) Updates the Water Cooler discussion thread associated with this Image.- Parameters:
id
- the Database ID of the discussion thread- Throws:
IllegalArgumentException
- if id is negative- See Also:
-
setName
Updates the name of this Image.- Parameters:
name
- the new Image name- Throws:
NullPointerException
- if name is null- See Also:
-
setDescription
Updates the Image's description.- Parameters:
desc
- the new Image description- Throws:
NullPointerException
- if desc is null- See Also:
-
setFleet
public void setFleet(boolean fleet) Updates if this image is part of the Fleet Gallery.- Parameters:
fleet
- TRUE if the image is part of the Fleet Gallery, otherwise FALSE- See Also:
-
addLike
public void addLike(int userID) Adds a like for this image.- Parameters:
userID
- the database ID of the liking user
-
setLikeCount
public void setLikeCount(int count) Updates the number of Likes for this Image.- Parameters:
count
- the number of Likes- Throws:
IllegalStateException
- if the Votes have already been loaded- See Also:
-
hasLiked
Checks if a particular person has cast a vote for this image- Parameters:
p
- the Person to check for- Returns:
- TRUE if the person has voted, otherwise FALSE
- See Also:
-
getLikes
Returns all votes for this image.- Returns:
- a Collection of votes for this image
- See Also:
-
getLikeCount
public int getLikeCount()Returns the number of Votes cast for this Image.- Returns:
- the number of Votes
- See Also:
-