use of org.mifos.platform.questionnaire.domain.ChoiceTagEntity in project head by mifos.
the class QuestionnaireMapperImpl method mapToChoiceTags.
private void mapToChoiceTags(ChoiceDto choiceDto, Set<ChoiceTagEntity> choiceTagEntities) {
if (isNotEmpty(choiceTagEntities)) {
List<String> choiceTags = new ArrayList<String>();
for (ChoiceTagEntity tag : choiceTagEntities) {
choiceTags.add(tag.getTagText());
}
choiceDto.setTags(choiceTags);
}
}
use of org.mifos.platform.questionnaire.domain.ChoiceTagEntity in project head by mifos.
the class QuestionnaireServiceIntegrationTest method getChoice.
private QuestionChoiceEntity getChoice(String choiceText, int choiceOrder, String... tagTexts) {
QuestionChoiceEntity questionChoiceEntity = new QuestionChoiceEntity();
questionChoiceEntity.setChoiceText(choiceText);
questionChoiceEntity.setChoiceOrder(choiceOrder);
Set<ChoiceTagEntity> tags = new HashSet<ChoiceTagEntity>();
for (String tagText : tagTexts) {
tags.add(getTag(tagText));
}
questionChoiceEntity.setTags(tags);
return questionChoiceEntity;
}
use of org.mifos.platform.questionnaire.domain.ChoiceTagEntity in project head by mifos.
the class QuestionnaireServiceIntegrationTest method getTag.
private ChoiceTagEntity getTag(String tagText) {
ChoiceTagEntity choiceTagEntity = new ChoiceTagEntity();
choiceTagEntity.setTagText(tagText);
return choiceTagEntity;
}
use of org.mifos.platform.questionnaire.domain.ChoiceTagEntity in project head by mifos.
the class QuestionnaireMapperImpl method mapToChoice.
private QuestionChoiceEntity mapToChoice(ChoiceDto choice) {
QuestionChoiceEntity choiceEntity = new QuestionChoiceEntity(choice.getValue());
choiceEntity.setChoiceOrder(choice.getOrder());
List<String> tags = choice.getTags();
if (isNotEmpty(tags)) {
Set<ChoiceTagEntity> choiceTagEntities = new LinkedHashSet<ChoiceTagEntity>();
for (String tag : tags) {
ChoiceTagEntity choiceTagEntity = new ChoiceTagEntity();
choiceTagEntity.setTagText(tag);
choiceTagEntities.add(choiceTagEntity);
}
choiceEntity.setTags(choiceTagEntities);
}
return choiceEntity;
}
use of org.mifos.platform.questionnaire.domain.ChoiceTagEntity in project head by mifos.
the class QuestionnaireMapperTest method getChoiceEntity.
private QuestionChoiceEntity getChoiceEntity(String choiceText, String... tagTexts) {
QuestionChoiceEntity choiceEntity = new QuestionChoiceEntity(choiceText);
Set<ChoiceTagEntity> tags = new HashSet<ChoiceTagEntity>();
for (String tagText : tagTexts) {
ChoiceTagEntity choiceTagEntity = new ChoiceTagEntity();
choiceTagEntity.setTagText(tagText);
tags.add(choiceTagEntity);
}
choiceEntity.setTags(tags);
return choiceEntity;
}
Aggregations