[SDC] Onboarding 1710 rebase.
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / vendor-license-rest / vendor-license-rest-services / src / main / java / org / openecomp / sdcrests / vendorlicense / rest / mapping / MapLimitEntityToLimitDto.java
1 package org.openecomp.sdcrests.vendorlicense.rest.mapping;
2
3 import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity;
4 import org.openecomp.sdcrests.mapping.MappingBase;
5 import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto;
6 import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto;
7
8 public class MapLimitEntityToLimitDto extends MappingBase<LimitEntity, LimitEntityDto> {
9
10   @Override
11   public void doMapping(LimitEntity source, LimitEntityDto target) {
12     target.setId(source.getId());
13     target.setName(source.getName());
14     target.setDescription(source.getDescription());
15     target.setMetric(source.getMetric() != null ? source.getMetric().name() : null);
16     target.setAggregationFunction(source.getAggregationFunction() != null ? source
17         .getAggregationFunction().name() : null);
18     target.setTime(source.getTime() != null ? source.getTime().name() : null);
19     target.setType(source.getType() != null ? source.getType().name() : null);
20     target.setUnit(source.getUnit());
21     target.setValue(source.getValue());
22   }
23 }