re base code
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / enums / NodeTypeEnum.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.datatypes.enums;
22
23 public enum NodeTypeEnum {
24     User("user"), 
25     Service("service"), 
26     Resource("resource"), 
27     Product("product"), 
28     ResourceCategory("resourceCategory"), 
29     ServiceCategory("serviceCategory"), 
30     ServiceNewCategory("serviceNewCategory"), 
31     ResourceNewCategory("resourceNewCategory"), 
32     ProductCategory("productCategory"), 
33     ResourceSubcategory("resourceSubcategory"), 
34     ProductSubcategory("productSubcategory"), 
35     ProductGrouping("productGrouping"), 
36     Tag("tag"), 
37     Property("property"), 
38     Attribute("attribute"), 
39     CapabilityType("capabilityType"), 
40     Requirement("requirement"), 
41     RelationshipType("relationshipType"), 
42     Capability("capability"), 
43     RequirementImpl("requirementImpl"), 
44     CapabilityInst("capabilityInst"), 
45     AttributeValue("attributeValue"), 
46     InputValue("inputValue"), 
47     PropertyValue("propertyValue"), 
48     LockNode("lockNode"), 
49     ArtifactRef("artifactRef"), 
50     Interface("interface"), 
51     InterfaceOperation("interfaceOperation"), 
52     ResourceInstance("resourceInstance"), 
53     RelationshipInst("relationshipInst"), 
54     AdditionalInfoParameters("additionalInfoParameters"), 
55     ConsumerCredentials("consumerCredentials"), 
56     HeatParameter("heatParameter"), 
57     HeatParameterValue("heatParameterValue"), 
58     DataType("dataType"), 
59     GroupType("groupType"), 
60     PolicyType("policyType"), 
61     Group("group"), 
62     UserFunctionalMenu("userFunctionalMenu"), 
63     Input("input"),
64     GroupInstance("groupInstance"),
65     AnnotationType("annotationType"),
66     Component("component");
67
68     private String name;
69
70     NodeTypeEnum(String name) {
71         this.name = name;
72     }
73
74     public String getName() {
75         return name;
76     }
77
78     public static NodeTypeEnum getByName(String name) {
79         for (NodeTypeEnum inst : NodeTypeEnum.values()) {
80             if (inst.getName().equals(name)) {
81                 return inst;
82             }
83         }
84         return null;
85     }
86
87     public static NodeTypeEnum getByNameIgnoreCase(String name) {
88         for (NodeTypeEnum inst : NodeTypeEnum.values()) {
89             if (inst.getName().equalsIgnoreCase(name)) {
90                 return inst;
91             }
92         }
93         return null;
94     }
95 }