re base code
[sdc.git] / asdctool / src / main / java / org / openecomp / sdc / asdctool / impl / validator / utils / ElementTypeEnum.java
1 package org.openecomp.sdc.asdctool.impl.validator.utils;
2
3 import org.openecomp.sdc.asdctool.impl.validator.executers.VfValidatorExecuter;
4
5 import java.util.ArrayList;
6 import java.util.List;
7
8 /**
9  * Created by chaya on 7/4/2017.
10  */
11 public enum ElementTypeEnum {
12
13     VF ("vf", VfValidatorExecuter.class);
14     //SERVICE("service", ServiceValidatorExecuter.class)
15
16     private String elementType;
17     private Class clazz;
18
19     ElementTypeEnum(String elementType, Class clazz) {
20        this. elementType = elementType;
21        this.clazz = clazz;
22     }
23
24     public static ElementTypeEnum getByType(String elementType){
25         for(ElementTypeEnum currType :ElementTypeEnum.values()){
26             if(currType.getElementType().equals(elementType)){
27                 return currType;
28             }
29         }
30         return null;
31     }
32
33     public static List<String> getAllTypes() {
34
35         List<String> arrayList = new ArrayList<String>();
36
37         for (ElementTypeEnum graphType : ElementTypeEnum.values()) {
38             arrayList.add(graphType.getElementType());
39         }
40         return arrayList;
41     }
42
43
44     public String getElementType() {
45         return elementType;
46     }
47
48     public void setElementType(String elementType) {
49         this.elementType = elementType;
50     }
51
52     public Class getClazz() {
53         return clazz;
54     }
55
56     public void setClazz(Class clazz) {
57         this.clazz = clazz;
58     }
59 }