fdd143d1d23c624b2ed1e22223631ad7f7597923
[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 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
17
18 import java.nio.ByteBuffer;
19 import lombok.Getter;
20 import lombok.NoArgsConstructor;
21 import lombok.Setter;
22 import org.openecomp.core.utilities.json.JsonUtil;
23 import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
24
25 @Getter
26 @Setter
27 @NoArgsConstructor
28 public class OrchestrationTemplateCandidateData {
29
30     private ByteBuffer contentData;
31     private String filesDataStructure;
32     private String fileSuffix;
33     private String fileName;
34     private String validationData;
35     private ByteBuffer originalFileContentData;
36     private String originalFileName;
37     private String originalFileSuffix;
38
39     public OrchestrationTemplateCandidateData(final ByteBuffer contentData, final String dataStructureJson, final String fileSuffix,
40                                               final String fileName, final String originalFileName, final String originalFileSuffix,
41                                               final ByteBuffer originalFileContentData) {
42         this.contentData = contentData;
43         this.filesDataStructure = dataStructureJson;
44         this.fileSuffix = fileSuffix;
45         this.fileName = fileName;
46         this.originalFileName = originalFileName;
47         this.originalFileSuffix = originalFileSuffix;
48         this.originalFileContentData = originalFileContentData;
49     }
50
51     public ValidationStructureList getValidationDataStructure() {
52         return validationData == null ? null : JsonUtil.json2Object(validationData, ValidationStructureList.class);
53     }
54 }