Class Message
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.cooler.Message
- All Implemented Interfaces:
- Serializable,- Comparable<Object>,- AuthoredBean,- IDBean,- RemoteAddressBean,- Cacheable
- Direct Known Subclasses:
- GetCoolerChannels.LastPostMessage
A class to store Water Cooler posts.
- Since:
- 1.0
- Version:
- 10.2
- Author:
- Luke
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintImplements default sort ordering by comparing the creation dates.intReturns the author of this message.getBody()Returns the message body.booleanReturns whether this message contains questionable content.Returns the date and time this post was written.Returns the remote IP address.Returns the remote host name.intGet the message thread ID.voidsetAuthorID(int id) Updates the author of this Message.voidUpdates this message's content.voidsetContentWarning(boolean isWarn) Toggles the content warning flag for this message.voidsetCreatedOn(Instant dt) Updates the date/time the message was written.voidsetRemoteAddr(String addr) Updates the IP address from where this message was posted.voidsetRemoteHost(String hostName) Updates the host name from where this message was posted.voidsetThreadID(int id) Updates the thread ID of this message.Methods inherited from class org.deltava.beans.DatabaseBeancacheKey, equals, getHexID, getID, hashCode, setID, validateID, validateIDMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.deltava.beans.RemoteAddressBeangetIsResolved
- 
Constructor Details- 
Messagepublic Message(int authorID) Create a new message object from a particular author.- Parameters:
- authorID- the database ID for the author
- Throws:
- IllegalArgumentException- if authorID is zero or negative
- See Also:
 
 
- 
- 
Method Details- 
getThreadIDpublic int getThreadID()Get the message thread ID. This is typically called by a DAO- Returns:
- the entry corresponding to the primary key in the COOLER_THREADS table in the database.
- See Also:
 
- 
getCreatedOnReturns the date and time this post was written.- Returns:
- the date/time this post was written
- See Also:
 
- 
getAuthorIDpublic int getAuthorID()Returns the author of this message.- Specified by:
- getAuthorIDin interface- AuthoredBean
- Returns:
- the database ID of the Pilot object for this message's author.
- See Also:
 
- 
getBody
- 
getRemoteAddrDescription copied from interface:RemoteAddressBeanReturns the remote IP address.- Specified by:
- getRemoteAddrin interface- RemoteAddressBean
- Returns:
- an IPv4 or IPv6 address
 
- 
getRemoteHostDescription copied from interface:RemoteAddressBeanReturns the remote host name.- Specified by:
- getRemoteHostin interface- RemoteAddressBean
- Returns:
- the host name, or address if unresolved
 
- 
getContentWarningpublic boolean getContentWarning()Returns whether this message contains questionable content.- Returns:
- TRUE if there is questionable content, otherwise FALSE
- See Also:
 
- 
setCreatedOnUpdates the date/time the message was written.- Parameters:
- dt- the date invalid input: '&' time this message was created
- See Also:
 
- 
setBodyUpdates this message's content.- Parameters:
- body- the new content of the message
 
- 
setThreadIDpublic void setThreadID(int id) Updates the thread ID of this message. This is typically called by a DAO- Parameters:
- id- the entry corresponding to the primary key in the COOLER_THREADS table in the database.
- Throws:
- IllegalArgumentException- if id is zero or negative
- See Also:
 
- 
setRemoteAddrUpdates the IP address from where this message was posted.- Parameters:
- addr- the IP address
- See Also:
 
- 
setRemoteHostUpdates the host name from where this message was posted.- Parameters:
- hostName- the host name
- See Also:
 
- 
setContentWarningpublic void setContentWarning(boolean isWarn) Toggles the content warning flag for this message.- Parameters:
- isWarn- TRUE if the message contains questionable content, otherwise FALSE
- See Also:
 
- 
setAuthorIDpublic void setAuthorID(int id) Updates the author of this Message.- Specified by:
- setAuthorIDin interface- AuthoredBean
- Parameters:
- id- the author's database ID
- Throws:
- IllegalArgumentException- if id is zero or negative
- See Also:
 
- 
compareToImplements default sort ordering by comparing the creation dates.- Specified by:
- compareToin interface- Comparable<Object>
- Overrides:
- compareToin class- DatabaseBean
- Throws:
- ClassCastException- if o2 isn't a Message
- See Also:
 
 
-