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.core.enrichment.types;
23 import java.util.Collections;
24 import java.util.HashMap;
28 public enum ArtifactCategory {
30 INFORMATIONAL("Informational"),
31 DEPLOYMENT("Deployment");
33 private static final Map<String, ArtifactCategory> mMap =
34 Collections.unmodifiableMap(initializeMapping());
35 private String displayName;
37 ArtifactCategory(String displayName) {
38 this.displayName = displayName;
42 * Initialize mapping map.
46 public static Map<String, ArtifactCategory> initializeMapping() {
47 Map<String, ArtifactCategory> typeMap = new HashMap<>();
48 for (ArtifactCategory v : ArtifactCategory.values()) {
49 typeMap.put(v.displayName, v);
55 * Gets artifact type by display name.
57 * @param displayName the display name
58 * @return the artifact type by display name
60 public static ArtifactCategory getArtifactTypeByDisplayName(String displayName) {
61 if (mMap.containsKey(displayName)) {
62 return mMap.get(displayName);
70 * @return the display name
72 public String getDisplayName() {