Improve test coverage
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / enums / NodeTypeEnum.java
1 /*-
2  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *      http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 package org.openecomp.sdc.be.datatypes.enums;
17
18 import lombok.AllArgsConstructor;
19 import lombok.Getter;
20
21 @Getter
22 @AllArgsConstructor
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 final String name;
69
70     public static NodeTypeEnum getByName(String name) {
71         for (NodeTypeEnum inst : NodeTypeEnum.values()) {
72             if (inst.getName().equals(name)) {
73                 return inst;
74             }
75         }
76         return null;
77     }
78
79     public static NodeTypeEnum getByNameIgnoreCase(String name) {
80         for (NodeTypeEnum inst : NodeTypeEnum.values()) {
81             if (inst.getName().equalsIgnoreCase(name)) {
82                 return inst;
83             }
84         }
85         return null;
86     }
87 }