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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.openecomp.sdc.be.datatypes.enums;
23 public enum ResourceTypeEnum {
25 VFC("VFC"/* (Virtual Function Component)"*/, true),
26 VF("VF"/* (Virtual Function)" */, false),
27 CR("CR"/* (Complex Resource"*/, false),
28 CP("CP"/* (Connection Point)"*/, true),
29 PNF("PNF"/* (Physical Network Function)" */, false),
30 CVFC("CVFC"/* Complex Virtual Function Component*/, false),
31 VL("VL"/* (Virtual Link)"*/, true),
32 VFCMT("VFCMT"/* (VFC Monitoring Template)"*/, true),
33 Configuration("Configuration ()", true),
34 ServiceProxy("ServiceProxy ()", true),
35 ABSTRACT("Abstract (Generic VFC/VF/PNF/Service Type)", true);
38 private boolean isAtomicType;
40 private ResourceTypeEnum(String value, boolean isAtomicType) {
42 this.isAtomicType = isAtomicType;
45 public String getValue() {
49 public boolean isAtomicType() {
53 public static ResourceTypeEnum getType(String type) {
54 for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
55 if (e.name().equals(type)) {
62 public static ResourceTypeEnum getTypeByName(String type) {
63 for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
64 if (e.name().equalsIgnoreCase(type)) {
72 * Returns ResourceTypeEnum matching to received String ignore case
77 public static ResourceTypeEnum getTypeIgnoreCase(String type) {
78 for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
79 if (e.name().toLowerCase().equals(type.toLowerCase())) {
87 * Checks if enum exist with given type
92 public static boolean containsName(String type) {
94 for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
95 if (e.name().equals(type)) {
103 * Checks if enum exist with given type ignore case
108 public static boolean containsIgnoreCase(String type) {
110 for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
111 if (e.name().toLowerCase().equals(type.toLowerCase())) {