1 package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.convertor;
3 import com.amdocs.zusammen.adaptor.inbound.api.types.item.Element;
4 import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo;
5 import com.amdocs.zusammen.datatypes.item.Info;
6 import org.openecomp.convertor.ElementConvertor;
7 import org.openecomp.core.utilities.file.FileUtils;
8 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity;
9 import org.openecomp.types.ElementPropertyName;
11 public class ElementToNicConvertor extends ElementConvertor <NicEntity>{
14 public NicEntity convert( Element element) {
15 NicEntity nicEntity = new NicEntity();
17 nicEntity.setId(element.getElementId().getValue());
18 nicEntity.setCompositionData(new String(FileUtils.toByteArray(element.getData())));
19 mapInfoToNicEntity(nicEntity,element.getInfo());
24 public NicEntity convert( ElementInfo elementInfo) {
25 NicEntity nicEntity = new NicEntity();
27 nicEntity.setId(elementInfo.getId().getValue());
28 mapInfoToNicEntity(nicEntity,elementInfo.getInfo());
33 public void mapInfoToNicEntity(NicEntity nicEntity,Info info){
35 nicEntity.setCompositionData(
36 info.getProperty(ElementPropertyName.compositionData.name()));