2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.be.datatypes.enums;
28 public enum ResourceTypeEnum {
30 VFC("VFC (Virtual Function Component)"),
31 VF("VF"/* (Virtual Function)" */),
32 CP("CP (Connection Point)"),
33 PNF("PNF"/* (Physical Network Function)" */),
34 CVFC("CVFC"/*Complex Virtual Function Component*/),
35 VL( "VL (Virtual Link)"),
36 VFCMT("VFCMT (VFC Monitoring Template)"),
37 ABSTRACT("Abstract (Generic VFC/VF/PNF/Service Type)");
41 private ResourceTypeEnum(String value) {
45 public String getValue() {
49 public static ResourceTypeEnum getType(String type) {
50 for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
51 if (e.name().equals(type)) {
58 public static ResourceTypeEnum getTypeByName(String type) {
59 for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
60 if (e.name().equalsIgnoreCase(type)) {
67 * Returns ResourceTypeEnum matching to received String ignore case
71 public static ResourceTypeEnum getTypeIgnoreCase(String type) {
72 for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
73 if (e.name().toLowerCase().equals(type.toLowerCase())) {
80 * Checks if enum exist with given type
84 public static boolean containsName(String type) {
86 for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
87 if (e.name().equals(type)) {
94 * Checks if enum exist with given type ignore case
98 public static boolean containsIgnoreCase(String type) {
100 for (ResourceTypeEnum e : ResourceTypeEnum.values()) {
101 if (e.name().toLowerCase().equals(type.toLowerCase())) {