org.davesag.generica.core
Class Faq

java.lang.Object
  extended byorg.davesag.generica.core.AbstractDateStamped
      extended byorg.davesag.generica.core.AbstractContent
          extended byorg.davesag.generica.core.Faq
All Implemented Interfaces:
Content, DateStamped, Localisable, Persistable, Serializable

public class Faq
extends AbstractContent

This Faq bean is a basic Localisable, Persitable FAQ entry with a question and answer.

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

Field Summary
protected  String theAnswer
          the answer
protected  String theQuestion
          the question
 
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
Faq()
          null constructor required by hibernate.
Faq(String q, String a, Locale loc)
          constructor takes a question, answer and locale.
Faq(String q, String a, String lang)
          constructor takes a question, answer and language code.
 
Method Summary
 boolean equals(Object o)
          Tests if the supplied object is equal to this Faq, ie do they have the same Id?
 String getAnswer()
          Get the answer to this Faq.
 String getQuestion()
          Get the author of this Faq.
 int hashcode()
          Objects must override the hashcode if they override the equals method.
 void setAnswer(String a)
          Set the Faq's answer.
 void setQuestion(String q)
          Set the Faq's question.
 String toString()
          The faq question and answer..
 
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
 

Field Detail

theQuestion

protected String theQuestion
the question


theAnswer

protected String theAnswer
the answer

Constructor Detail

Faq

public Faq()
null constructor required by hibernate.


Faq

public Faq(String q,
           String a,
           String lang)
constructor takes a question, answer and language code.

Parameters:
q - The Question.
a - The Answer.
lang - The Language Code.

Faq

public Faq(String q,
           String a,
           Locale loc)
constructor takes a question, answer and locale.

Parameters:
q - The Question.
a - The Answer.
loc - The Locale.
Method Detail

getQuestion

public String getQuestion()
Get the author of this Faq.

Returns:
The author of this Faq.
Hibernate Property:
length = "255"

setQuestion

public void setQuestion(String q)
Set the Faq's question.

Parameters:
q - The question.

getAnswer

public String getAnswer()
Get the answer to this Faq.

Returns:
The answer to this Faq.
Hibernate Property:
length = "1024"

setAnswer

public void setAnswer(String a)
Set the Faq's answer.

Parameters:
a - The answer of this Faq.

toString

public String toString()
The faq question and answer..

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

equals

public boolean equals(Object o)
Tests if the supplied object is equal to this Faq, ie do they have the same Id?

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

hashcode

public int hashcode()
Objects must override the hashcode if they override the equals method.

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


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