push addional code
[sdc.git] / openecomp-be / lib / openecomp-heat-lib / src / main / java / org / openecomp / sdc / heat / datatypes / manifest / FileData.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.sdc.heat.datatypes.manifest;
22
23 import java.util.Arrays;
24 import java.util.HashSet;
25 import java.util.List;
26 import java.util.Set;
27 import java.util.function.Predicate;
28
29 public class FileData {
30
31   public static Set<Type> heatFileTypes =
32       new HashSet<>(Arrays.asList(Type.HEAT, Type.HEAT_NET, Type.HEAT_VOL));
33   private Boolean isBase;
34   private String file;
35   private Type type;
36   private List<FileData> data;
37
38   public static Predicate<FileData> buildFileDataPredicateByType(Type... types) {
39     return fileData -> Arrays.asList(types).contains(fileData.getType());
40   }
41
42   public static boolean isHeatFile(Type type) {
43     return heatFileTypes.contains(type);
44   }
45
46   public Boolean getBase() {
47     return isBase;
48   }
49
50   public void setBase(Boolean base) {
51     isBase = base;
52   }
53
54   public String getFile() {
55     return file;
56   }
57
58   public void setFile(String file) {
59     this.file = file;
60   }
61
62   public Type getType() {
63     return type;
64   }
65
66   public void setType(Type type) {
67     this.type = type;
68   }
69
70   public List<FileData> getData() {
71     return data;
72   }
73
74   public void setData(List<FileData> data) {
75     this.data = data;
76   }
77
78   public enum Type {
79
80     HEAT("HEAT"),
81     HEAT_ENV("HEAT_ENV"),
82     HEAT_NET("HEAT_NET"),
83     HEAT_VOL("HEAT_VOL"),
84     CHEF("CHEF"),
85     PUPPET("PUPPET"),
86     SHELL("SHELL"),
87     YANG("YANG"),
88     YANG_XML("YANG_XML"),
89     BPEL("BPEL"),
90     DG_XML("DG_XML"),
91     MURANO_PKG("MURANO_PKG"),
92     VENDOR_LICENSE("VENDOR_LICENSE"),
93     VF_LICENSE("VF_LICENSE"),
94     OTHER("OTHER");
95
96     private String displayName;
97
98     Type(String displayName) {
99       this.displayName = displayName;
100     }
101
102     public String getDisplayName() {
103       return displayName;
104     }
105
106   }
107 }