org.davesag.generica.core
Class Category

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.Category
All Implemented Interfaces:
Content, DateStamped, Extensible, Localisable, Persistable, Serializable

public class Category
extends AbstractExtensibleContent
implements Serializable, Extensible

This Category bean represents a basic Category suitable as a content seperator for any content management system where stories should be displayed on a website in various categories. The categories are designed to be localizable.

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

Field Summary
protected  String theDescription
          the description of this Category
protected  String theName
          the name of this Category
 
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
Category()
          null constructor required by hibernate.
Category(String name, Locale loc)
          constructor takes a member and populates this summary object with the values required in common to all member displays.
 
Method Summary
 boolean equals(Object o)
          Tests if the supplied object is equal to this Category.
 String getDescription()
          get the description of the category.
 String getName()
          get the name of the category.
 int hashcode()
          You must override the hashcode if you override the equals method.
 void setDescription(String desc)
          Set a short description of this Category.
 void setName(String name)
          Set the Category's name.
 String toString()
          a short string identifying the category.
 
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.Extensible
addMetaData, getMetaData, getMetaData, removeMetaData, setMetaData
 
Methods inherited from interface org.davesag.generica.core.DateStamped
getCreated, getLastModified, setCreated, setLastModified
 

Field Detail

theName

protected String theName
the name of this Category


theDescription

protected String theDescription
the description of this Category

Constructor Detail

Category

public Category()
null constructor required by hibernate.


Category

public Category(String name,
                Locale loc)
constructor takes a member and populates this summary object with the values required in common to all member displays.

Parameters:
name - The name of the Category.
loc - The locale for this Category.
Method Detail

getName

public String getName()
get the name of the category.

Returns:
The name of this Category. In practice you would use StringUtils.escapeString to display this on a web page or in an rss feed.
Hibernate Property:
length = "255"

setName

public void setName(String name)
Set the Category's name.

Parameters:
name - The name of this Category.

getDescription

public String getDescription()
get the description of the category.

Returns:
A short description of this Category. Can be null.
Hibernate Property:
length = "1024"

setDescription

public void setDescription(String desc)
Set a short description of this Category.

Parameters:
desc - A description of this Category.

toString

public String toString()
a short string identifying the category.

Specified by:
toString in class AbstractContent
Returns:
the Category name. useful for debugging.

equals

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

Overrides:
equals in class AbstractExtensibleContent
Parameters:
o - The object to test against this Category. Must also be a Category 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 Category.


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