re base code
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / enums / InstantiationTypes.java
1 package org.openecomp.sdc.be.datatypes.enums;
2
3 import java.util.stream.Stream;
4
5 public enum InstantiationTypes {
6         
7         A_LA_CARTE("A-la-carte"),
8         MACRO("Macro");
9         
10         private String value;
11         
12         private InstantiationTypes(String value) {
13                 this.value = value;
14         }
15         
16         public String getValue() {
17                 return value;
18         }
19         
20         /**
21          * Checks if enum with the given type exists.
22          *
23          * @param type
24          * @return bool
25          */
26         
27         public static boolean containsName(String type) {
28                 return Stream.of(InstantiationTypes.values())
29                                 .anyMatch(instType -> type.equals(instType.getValue()));
30         }       
31 }