Class 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 Detail

      • QuestionEntity

        protected QuestionEntity()
    • Method Detail

      • 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()
      • 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)