Merge "[1707-OS] Updated license text according to the"
[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
66         private String name;
67
68         NodeTypeEnum(String name) {
69                 this.name = name;
70         }
71
72         public String getName() {
73                 return name;
74         }
75
76         public static NodeTypeEnum getByName(String name) {
77                 for (NodeTypeEnum inst : NodeTypeEnum.values()) {
78                         if (inst.getName().equals(name)) {
79                                 return inst;
80                         }
81                 }
82                 return null;
83         }
84
85         public static NodeTypeEnum getByNameIgnoreCase(String name) {
86                 for (NodeTypeEnum inst : NodeTypeEnum.values()) {
87                         if (inst.getName().equalsIgnoreCase(name)) {
88                                 return inst;
89                         }
90                 }
91                 return null;
92         }
93 }