org.davesag.generica.core
Class Comment

java.lang.Object
  extended byorg.davesag.generica.core.AbstractDateStamped
      extended byorg.davesag.generica.core.AbstractContent
          extended byorg.davesag.generica.core.AbstractExtensibleContent
              extended byorg.davesag.generica.core.AbstractText
                  extended byorg.davesag.generica.core.Comment
All Implemented Interfaces:
Authorable, Content, DateStamped, Extensible, Localisable, Persistable, Serializable

public class Comment
extends AbstractText

This Comment bean represents a basic text item suitable as a base for any content management system where comments should be displayed on a website. The comments are designed to be localizable.

Since:
Generica 1.0
Version:
CVS Revision $Id: Comment.java,v 1.13 2004/04/08 13:19:07 davesag Exp $
Author:
Dave Sag http://www.davesag.com
See Also:
Story, Media, Serialized Form

Field Summary
 
Fields inherited from class org.davesag.generica.core.AbstractText
theAuthor, theText, theTitle
 
Fields inherited from class org.davesag.generica.core.AbstractExtensibleContent
theMetaData
 
Fields inherited from class org.davesag.generica.core.AbstractContent
theCountryCode, theLanguageCode
 
Fields inherited from class org.davesag.generica.core.AbstractDateStamped
theCreated, theId, theLastModified
 
Constructor Summary
Comment()
          null constructor required by hibernate.
Comment(String title, User author, String text, Locale loc)
          Constructor that takes a title, author and text.
Comment(String title, User author, String text, String lang)
          Constructor that takes a title, author and text.
 
Method Summary
 boolean equals(Object o)
          Tests if the supplied object is equal to this Comment.
 int hashcode()
          You must override the hashcode if you override the equals method.
 String toString()
          a short string that identifies tyhe comment.
 
Methods inherited from class org.davesag.generica.core.AbstractText
getAuthor, getText, getTitle, setAuthor, setText, setTitle
 
Methods inherited from class org.davesag.generica.core.AbstractExtensibleContent
addMetaData, getMetaData, getMetaData, removeMetaData, setMetaData
 
Methods inherited from class org.davesag.generica.core.AbstractContent
getCountryCode, getLanguageCode, getLocale, setCountryCode, setLanguageCode, setLocale
 
Methods inherited from class org.davesag.generica.core.AbstractDateStamped
getCreated, getId, getLastModified, setCreated, setId, setLastModified, setTemplateId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.davesag.generica.core.DateStamped
getCreated, getLastModified, setCreated, setLastModified
 

Constructor Detail

Comment

public Comment()
null constructor required by hibernate.


Comment

public Comment(String title,
               User author,
               String text,
               String lang)
Constructor that takes a title, author and text.

Parameters:
title - The title of the Comment.
author - The User that wrote the Comment.
text - The text of the Comment.
lang - The ISO Language Code.

Comment

public Comment(String title,
               User author,
               String text,
               Locale loc)
Constructor that takes a title, author and text.

Parameters:
title - The title of the Comment.
author - The User that wrote the Comment.
text - The text of the Comment.
loc - The Locale used to determine the ISO Language Code.
Method Detail

toString

public String toString()
a short string that identifies tyhe comment.

Specified by:
toString in class AbstractContent
Returns:
the comment title. useful for debugging.

equals

public boolean equals(Object o)
Tests if the supplied object is equal to this Comment.

Overrides:
equals in class AbstractText
Parameters:
o - The object to test against this Comment. Must also be a Comment to make sense.
Returns:
true if the two users have the same id.

hashcode

public int hashcode()
You must override the hashcode if you override the equals method.

Specified by:
hashcode in class AbstractContent
Returns:
a valid hashcode for this story.


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.