Package org.silverpeas.components.questionreply.web

# Class QuestionEntity

java.lang.Object
org.silverpeas.components.questionreply.web.QuestionEntity

All Implemented Interfaces:
  `Serializable`, `org.silverpeas.core.web.rs.WebEntity`

public class QuestionEntity extends Object implements org.silverpeas.core.web.rs.WebEntity

Author:
  emmanuel.hugonnet@silverpeas.org
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `QuestionEntity()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `static QuestionEntity`
  `fromQuestion(Question question, String lang)`
  Creates a new question entity from the specified question.
  `static List<QuestionEntity>`
  `fromQuestions(Iterable<Question> questions, String lang)`
  Creates several new reply entities from the specified list of questions.
  `String`
  `getCategoryId()`
  `String`
  `getContent()`
  `String`
  `getCreationDate()`
  `AuthorEntity`
  `getCreator()`
  `String`
  `getCreatorId()`
  `String`
  `getId()`
  `String`
  `getInstanceId()`
  `int`
  `getPrivateReplyNumber()`
  `int`
  `getPublicReplyNumber()`
  `int`
  `getReplyNumber()`
  `int`
  `getStatus()`
  `String`
  `getTitle()`
  `URI`
  `getURI()`
  Gets the URI of this comment entity.
  `int`
  `hashCode()`
  `Question`
  `toQuestion()`
  Gets the reply business objet this entity represent.
  `String`
  `toString()`
  `QuestionEntity`
  `withURI(URI uri)`
  Sets a URI to this entity.
  `QuestionEntity`
  `withUser(org.silverpeas.core.admin.user.model.User user, org.silverpeas.core.admin.user.model.SilverpeasRole profile)`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### QuestionEntity

    protected QuestionEntity()

- ## Method Details

  - ### withURI

    public QuestionEntity withURI(URI uri)
    Sets a URI to this entity. With this URI, it can then be accessed through the Web.
    Parameters:
      `uri` - the web entity URI.
    Returns:
      itself.

  - ### getURI

    public URI getURI()
    Gets the URI of this comment entity.
    Specified by:
      `getURI` in interface `org.silverpeas.core.web.rs.WebEntity`
    Returns:
      the URI with which this entity can be access through the Web.

  - ### getCategoryId

    public String getCategoryId()

  - ### getContent

    public String getContent()

  - ### getCreationDate

    public String getCreationDate()

  - ### getCreatorId

    public String getCreatorId()

  - ### getId

    public String getId()

  - ### getInstanceId

    public String getInstanceId()

  - ### getPrivateReplyNumber

    public int getPrivateReplyNumber()

  - ### getPublicReplyNumber

    public int getPublicReplyNumber()

  - ### getReplyNumber

    public int getReplyNumber()

  - ### getStatus

    public int getStatus()

  - ### getTitle

    public String getTitle()

  - ### getCreator

    public AuthorEntity getCreator()

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### fromQuestion

    public static QuestionEntity fromQuestion(Question question, String lang)
    Creates a new question entity from the specified question.
    Parameters:
      `question` - the question to entitify.
      `lang` - the language of the current User.
    Returns:
      the entity representing the specified question.

  - ### fromQuestions

    public static List<QuestionEntity> fromQuestions(Iterable<Question> questions, String lang)
    Creates several new reply entities from the specified list of questions.
    Parameters:
      `questions` - the list of questions to entitify.
      `lang` - the language of the current User.
    Returns:
      a list of entities representing each of then one of the specified questions.

  - ### toQuestion

    public Question toQuestion()
    Gets the reply business objet this entity represent.
    Returns:
      a reply instance.

  - ### withUser

    public QuestionEntity withUser(org.silverpeas.core.admin.user.model.User user, org.silverpeas.core.admin.user.model.SilverpeasRole profile)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`