Class AnswerPercentEntity
java.lang.Object
org.silverpeas.components.survey.web.AnswerPercentEntity
- All Implemented Interfaces:
Serializable,org.silverpeas.core.web.rs.WebEntity
This is a representation of an answer percent against other answer percents of a question.
- Author:
- silveryocha
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<AnswerPercentEntity>asWebEntities(Collection<org.silverpeas.core.questioncontainer.answer.model.Answer> answers, int nbVoters, boolean isUsers) Gets the given collection of answers to a question into a list ofAnswerPercentEntityinstances.The WEB entity representation of anAnswer.The percent representation of the answer against the others for a question.getURI()voidsetAnswer(AnswerEntity answer) voidsetPercent(BigDecimal percent)
-
Constructor Details
-
AnswerPercentEntity
protected AnswerPercentEntity()
-
-
Method Details
-
asWebEntities
public static List<AnswerPercentEntity> asWebEntities(Collection<org.silverpeas.core.questioncontainer.answer.model.Answer> answers, int nbVoters, boolean isUsers) Gets the given collection of answers to a question into a list ofAnswerPercentEntityinstances.- Parameters:
answers- answers to a question.nbVoters- the total number of survey voters.isUsers- false to shut down the percent computation, true otherwise.- Returns:
- a list of
AnswerPercentEntityinstances.
-
getAnswer
The WEB entity representation of anAnswer.- Returns:
- an
AnswerEntityinstance.
-
setAnswer
-
getPercent
The percent representation of the answer against the others for a question.- Returns:
- a
BigDecimalinstance.
-
setPercent
-
getURI
- Specified by:
getURIin interfaceorg.silverpeas.core.web.rs.WebEntity
-