Add collaboration feature
[sdc.git] / openecomp-be / lib / openecomp-core-lib / openecomp-zusammen-lib / openecomp-zusammen-api / src / main / java / org / openecomp / convertor / ElementConvertor.java
1 package org.openecomp.convertor;
2
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;
9
10 public abstract class ElementConvertor<T> {
11
12   public static ElementType getElementType(Element element) {
13     return ElementType
14         .valueOf(element.getInfo().getProperty(ElementPropertyName.elementType.name()));
15   }
16
17   public static String getElementName(Element element) {
18     return element.getInfo().getName();
19   }
20
21
22   abstract public T convert(Element element);
23
24   public T convert( ElementInfo elementInfo) {
25     throw new UnsupportedOperationException("convert elementInfo item is not supported ");
26   }
27
28
29   public T convert( Item item) {
30     throw new UnsupportedOperationException("convert from item is not supported ");
31   }
32
33
34   public T convert( ItemVersion itemVersion) {
35     throw new UnsupportedOperationException("convert from itemVersion is not supported ");
36   }
37 }