Interface AnswerService

    • Method Detail

      • getAnswersByQuestionPK

        Collection<Answer> getAnswersByQuestionPK​(ResourceReference questionPK)
        Get answers which composed the question
        Parameters:
        questionPK - the QuestionPK (question id)
        Returns:
        a Collection of Answer
      • recordThisAnswerAsVote

        void recordThisAnswerAsVote​(ResourceReference questionPK,
                                    AnswerPK answerPK)
        Record that the answer (answerPK) has been chosen to the question (questionPK)
        Parameters:
        questionPK - the QuestionPK (question id)
        answerPK - the AnswerPK (answer id)
      • addAnswersToAQuestion

        void addAnswersToAQuestion​(Collection<Answer> answers,
                                   ResourceReference questionPK)
        Add some answers to a question
        Parameters:
        answers - a Collection of Answer
        questionPK - the QuestionPK (question id)
      • addAnswerToAQuestion

        void addAnswerToAQuestion​(Answer answer,
                                  ResourceReference questionPK)
        Add an answer to a question
        Parameters:
        answer - the Answer
        questionPK - the QuestionPK (question id)
      • updateAnswerToAQuestion

        void updateAnswerToAQuestion​(ResourceReference questionPK,
                                     Answer answer)
        Update an answer to a question
        Parameters:
        questionPK - the QuestionPK (question id)
        answer - the Answer
      • deleteAnswersToAQuestion

        void deleteAnswersToAQuestion​(ResourceReference questionPK)
        Delete all answers to a given question
        Parameters:
        questionPK - the QuestionPK (question id)
      • deleteAnswerToAQuestion

        void deleteAnswerToAQuestion​(ResourceReference questionPK,
                                     String answerId)
        Delete an answer to a question
        Parameters:
        questionPK - the QuestionPK (question id)
        answerId - the answer id