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.heat.datatypes.model;
23 import java.util.HashMap;
26 public enum ResourceTypeToMessageString {
27 SERVER_GROUP(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE, "ServerGroup"),
28 SECURITY_GROUP(HeatResourcesTypes.NEUTRON_SECURITY_GROUP_RESOURCE_TYPE, "SecurityGroup"),
29 NETWORK_POLICY(HeatResourcesTypes.CONTRAIL_NETWORK_RULE_RESOURCE_TYPE, "NetworkPolicy");
31 private static Map<HeatResourcesTypes, String> resourcesTypesStringMap;
34 resourcesTypesStringMap = new HashMap<>();
36 for (ResourceTypeToMessageString resourceTypeToMessageString : ResourceTypeToMessageString
38 resourcesTypesStringMap
39 .put(resourceTypeToMessageString.type, resourceTypeToMessageString.messageString);
43 private String messageString;
44 private HeatResourcesTypes type;
47 ResourceTypeToMessageString(HeatResourcesTypes type, String messgageString) {
49 this.messageString = messgageString;
52 public static String getTypeForMessageFromResourceType(HeatResourcesTypes type) {
53 return resourcesTypesStringMap.get(type);