org.bejug.javacareers.jobs.model
Class Comment

java.lang.Object
  extended byorg.bejug.javacareers.jobs.model.AbstractPersistableObject
      extended byorg.bejug.javacareers.jobs.model.Comment
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class Comment
extends AbstractPersistableObject

The comment which is linked to one Offer.

Version:
$Revision: 1.6 $ - $Date: 2005/12/20 15:36:45 $
Author:
Stephan Janssen (Last modified by $Author: shally $)
See Also:
Serialized Form

Constructor Summary
Comment()
          Default constructor needed for Hibernate.
Comment(Item offer, User user, java.lang.String subject, java.lang.String content)
           
Comment(java.lang.String subject, java.lang.String content)
           
 
Method Summary
 void addChildComment(Comment childComment)
          Convenience method to add a child comment.
 void addUser(User newuser)
          adds the user to the comment.
 int compareTo(java.lang.Object comment)
          method to implement for the comparator.
 boolean equals(java.lang.Object o)
          
 java.util.Set getChildComments()
          Returns the child comments.
 java.lang.String getContent()
          Returns the comment content.
 Item getOffer()
          Returns the related offer.
 Comment getParentComment()
          Returns the parent comment.
 java.lang.String getSubject()
           
 User getUser()
           
 int hashCode()
          
 void setChildComments(java.util.Set childComments)
          Set the child comments.
 void setContent(java.lang.String content)
          Set the comment content.
 void setOffer(Item offer)
          The offer to which the comment is related to.
 void setParentComment(Comment parentComment)
          Set the parent comment, if null then this comment is the root comment.
 void setSubject(java.lang.String subject)
           
 void setUser(User user)
           
 java.lang.String toString()
          
 
Methods inherited from class org.bejug.javacareers.jobs.model.AbstractPersistableObject
getCreationDate, getId, getModificationDate, getVersion, isEditable, isNew, setCreationDate, setEditable, setId, setModificationDate, setVersion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Comment

public Comment()
Default constructor needed for Hibernate.


Comment

public Comment(Item offer,
               User user,
               java.lang.String subject,
               java.lang.String content)
Parameters:
offer - The offer to set.
user - The user to set.
subject - The subject to set.
content - The content to set

Comment

public Comment(java.lang.String subject,
               java.lang.String content)
Parameters:
subject - The subject to set.
content - The content to set
Method Detail

getSubject

public java.lang.String getSubject()
Returns:
the subject

setSubject

public void setSubject(java.lang.String subject)
Parameters:
subject - The subject to set

setOffer

public void setOffer(Item offer)
The offer to which the comment is related to.

Parameters:
offer - the offer.

getOffer

public Item getOffer()
Returns the related offer.

Returns:
returns the related offer.

getParentComment

public Comment getParentComment()
Returns the parent comment.

Returns:
The parent comment.

setParentComment

public void setParentComment(Comment parentComment)
Set the parent comment, if null then this comment is the root comment.

Parameters:
parentComment - the parent comment.

getChildComments

public java.util.Set getChildComments()
Returns the child comments.

Returns:
The child comments.

setChildComments

public void setChildComments(java.util.Set childComments)
Set the child comments.

Parameters:
childComments - the child comments.

getContent

public java.lang.String getContent()
Returns the comment content.

Returns:
returns the comment content.

setContent

public void setContent(java.lang.String content)
Set the comment content.

Parameters:
content - The comment content.

addChildComment

public void addChildComment(Comment childComment)
Convenience method to add a child comment.

Parameters:
childComment - The child comment.

getUser

public User getUser()
Returns:
Returns the user.

setUser

public void setUser(User user)
Parameters:
user - The user to set.

addUser

public void addUser(User newuser)
adds the user to the comment.

Parameters:
newuser - the user to add.

compareTo

public int compareTo(java.lang.Object comment)
method to implement for the comparator.

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class AbstractPersistableObject
Parameters:
comment - the other comment to compare with.
Returns:
an int containing the result of the comparison.

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class AbstractPersistableObject

hashCode

public int hashCode()

Overrides:
hashCode in class AbstractPersistableObject

toString

public java.lang.String toString()

Overrides:
toString in class AbstractPersistableObject


Copyright © 2005-2006 BeJUG. All Rights Reserved.