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 protected
AnswerPercentEntity()
-
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 ofAnswerPercentEntity
instances.AnswerEntity
getAnswer()
The WEB entity representation of anAnswer
.BigDecimal
getPercent()
The percent representation of the answer against the others for a question.URI
getURI()
void
setAnswer(AnswerEntity answer)
void
setPercent(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 ofAnswerPercentEntity
instances.- 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
AnswerPercentEntity
instances.
-
getAnswer
public AnswerEntity getAnswer()
The WEB entity representation of anAnswer
.- Returns:
- an
AnswerEntity
instance.
-
setAnswer
public void setAnswer(AnswerEntity answer)
-
getPercent
public BigDecimal getPercent()
The percent representation of the answer against the others for a question.- Returns:
- a
BigDecimal
instance.
-
setPercent
public void setPercent(BigDecimal percent)
-
getURI
public URI getURI()
- Specified by:
getURI
in interfaceorg.silverpeas.core.web.rs.WebEntity
-
-