/** * @param aggregatedVoteE * @return */ public static Vote aggregatedVoteEntityToVoteMessage(AggregatedVoteE aggregatedVoteE) { // basic mapping for general vote entities Vote vote = voteEntityToVoteMessage(aggregatedVoteE); // map additional specific base attributes vote.setAggregation(true); if (aggregatedVoteE.getAggregationType() != null) { vote.setAggregationType(aggregatedVoteE.getAggregationType()); } else { log.error("Required attribute 'aggregationType' missing"); return null; } if (aggregatedVoteE.getClusterId() != null) { vote.setClusterId(aggregatedVoteE.getClusterId()); } else { log.error("Required attribute 'clusterId' missing"); return null; } // generate url links vote.setConfigurationUrl(genConfigUrl(aggregatedVoteE)); vote.setVoteUrl(genUrl(aggregatedVoteE)); vote.setEvaluationUrl(EvaluationMapper.genUrl(aggregatedVoteE.getAggregatorEvaluation())); return vote; }