[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-be / lib / openecomp-sdc-enrichment-lib / openecomp-sdc-enrichment-api / src / main / java / org / openecomp / core / enrichment / types / ArtifactCategory.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.core.enrichment.types;
22
23 import java.util.Collections;
24 import java.util.HashMap;
25 import java.util.Map;
26
27
28 public enum ArtifactCategory {
29
30   INFORMATIONAL("Informational"),
31   DEPLOYMENT("Deployment");
32
33   private static final Map<String, ArtifactCategory> mMap =
34       Collections.unmodifiableMap(initializeMapping());
35   private String displayName;
36
37   ArtifactCategory(String displayName) {
38     this.displayName = displayName;
39   }
40
41   /**
42    * Initialize mapping map.
43    *
44    * @return the map
45    */
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);
50     }
51     return typeMap;
52   }
53
54   /**
55    * Gets artifact type by display name.
56    *
57    * @param displayName the display name
58    * @return the artifact type by display name
59    */
60   public static ArtifactCategory getArtifactTypeByDisplayName(String displayName) {
61     if (mMap.containsKey(displayName)) {
62       return mMap.get(displayName);
63     }
64     return null;
65   }
66
67   /**
68    * Gets display name.
69    *
70    * @return the display name
71    */
72   public String getDisplayName() {
73     return displayName;
74   }
75
76
77 }