56dabc5dc2be9ae146a44c177f46fff46b2279bc
[sdc.git] / openecomp-be / lib / openecomp-tosca-lib / src / main / java / org / openecomp / sdc / tosca / csar / ToscaMetaEntry.java
1 /*
2  *(===========LICENSE_START=======================================================
3  *  Copyright (C) 2019 Nordix Foundation
4  * (===============================================================================
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  *
16  *  SPDX-License-Identifier: Apache-2.0
17  * (===========LICENSE_END=========================================================
18  */
19
20 package org.openecomp.sdc.tosca.csar;
21
22 import java.util.Arrays;
23 import java.util.Optional;
24
25 public enum ToscaMetaEntry {
26     TOSCA_META_PATH_FILE_NAME("TOSCA-Metadata/TOSCA.meta"),
27     TOSCA_META_FILE_VERSION_ENTRY("TOSCA-Meta-File-Version"),
28     CSAR_VERSION_ENTRY("CSAR-Version"),
29     CREATED_BY_ENTRY("Created-By"),
30     ENTRY_DEFINITIONS("Entry-Definitions"),
31     ENTRY_EVENTS("Entry-Events"),
32     ETSI_ENTRY_MANIFEST("ETSI-Entry-Manifest"),
33     ETSI_ENTRY_CHANGE_LOG("ETSI-Entry-Change-Log"),
34     ETSI_ENTRY_TESTS("ETSI-Entry-Tests"),
35     ETSI_ENTRY_LICENSES("ETSI-Entry-Licenses"),
36     ETSI_ENTRY_CERTIFICATE("ETSI-Entry-Certificate"),
37     TOSCA_META_FILE_VERSION("1.0");
38
39     private final String name;
40
41     ToscaMetaEntry(final String name) {
42         this.name = name;
43     }
44
45     public String getName() {
46         return name;
47     }
48
49     public static Optional<ToscaMetaEntry> parse(final String name) {
50         return Arrays.stream(values()).filter(toscaMetaEntry -> toscaMetaEntry.getName().equals(name)).findFirst();
51     }
52 }