1 package org.openecomp.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.Item;
6 import com.amdocs.zusammen.datatypes.item.ItemVersion;
7 import org.openecomp.sdc.datatypes.model.ElementType;
8 import org.openecomp.types.ElementPropertyName;
10 public abstract class ElementConvertor<T> {
12 public static ElementType getElementType(Element element) {
14 .valueOf(element.getInfo().getProperty(ElementPropertyName.elementType.name()));
17 public static String getElementName(Element element) {
18 return element.getInfo().getName();
22 abstract public T convert(Element element);
24 public T convert( ElementInfo elementInfo) {
25 throw new UnsupportedOperationException("convert elementInfo item is not supported ");
29 public T convert( Item item) {
30 throw new UnsupportedOperationException("convert from item is not supported ");
34 public T convert( ItemVersion itemVersion) {
35 throw new UnsupportedOperationException("convert from itemVersion is not supported ");