Class AnswerPercentEntity
- java.lang.Object
-
- org.silverpeas.components.survey.web.AnswerPercentEntity
-
- All Implemented Interfaces:
Serializable,org.silverpeas.core.web.rs.WebEntity
public class AnswerPercentEntity extends Object implements 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:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAnswerPercentEntity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.AnswerEntitygetAnswer()The WEB entity representation of anAnswer.BigDecimalgetPercent()The percent representation of the answer against the others for a question.URIgetURI()voidsetAnswer(AnswerEntity answer)voidsetPercent(BigDecimal percent)
-
-
-
Method Detail
-
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
public AnswerEntity getAnswer()
The WEB entity representation of anAnswer.- Returns:
- an
AnswerEntityinstance.
-
setAnswer
public void setAnswer(AnswerEntity answer)
-
getPercent
public BigDecimal getPercent()
The percent representation of the answer against the others for a question.- Returns:
- a
BigDecimalinstance.
-
setPercent
public void setPercent(BigDecimal percent)
-
getURI
public URI getURI()
- Specified by:
getURIin interfaceorg.silverpeas.core.web.rs.WebEntity
-
-