c5e470e9c68dfdebab88b310e664851b58a030a9
[sdc.git] /
1 /*
2  * Copyright © 2016-2018 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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
17 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
18
19 import java.nio.ByteBuffer;
20 import lombok.Getter;
21 import lombok.NoArgsConstructor;
22 import lombok.Setter;
23 import org.openecomp.core.utilities.json.JsonUtil;
24 import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
25
26 @Getter
27 @Setter
28 @NoArgsConstructor
29 public class OrchestrationTemplateCandidateData {
30
31     private ByteBuffer contentData;
32     private String filesDataStructure;
33     private String fileSuffix;
34     private String fileName;
35     private String validationData;
36     private ByteBuffer originalFileContentData;
37     private String originalFileName;
38     private String originalFileSuffix;
39
40     public OrchestrationTemplateCandidateData(final ByteBuffer contentData,
41                                               final String dataStructureJson,
42                                               final String fileSuffix, final String fileName,
43                                               final String originalFileName,
44                                               final String originalFileSuffix,
45                                               final ByteBuffer originalFileContentData) {
46         this.contentData = contentData;
47         this.filesDataStructure = dataStructureJson;
48         this.fileSuffix = fileSuffix;
49         this.fileName = fileName;
50         this.originalFileName = originalFileName;
51         this.originalFileSuffix = originalFileSuffix;
52         this.originalFileContentData = originalFileContentData;
53     }
54
55     public ValidationStructureList getValidationDataStructure() {
56         return validationData == null ? null
57             : JsonUtil.json2Object(validationData, ValidationStructureList.class);
58     }
59
60 }