[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-be / lib / openecomp-sdc-vendor-software-product-lib / openecomp-sdc-vendor-software-product-api / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / dao / type / UploadDataEntity.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.vendorsoftwareproduct.dao.type;
22
23 import org.openecomp.core.utilities.json.JsonUtil;
24 import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList;
25 import org.openecomp.sdc.versioning.dao.types.Version;
26 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
27
28 import java.nio.ByteBuffer;
29
30 public class UploadDataEntity implements VersionableEntity {
31   private static final String ENTITY_TYPE = "Vendor Software Product Upload data";
32
33   private String id;
34
35   private Version version;
36
37   private String packageName;
38
39   private String packageVersion;
40
41   private String validationData;
42
43   private ByteBuffer contentData;
44
45   public UploadDataEntity() {
46   }
47
48   public UploadDataEntity(String id, Version version) {
49     this.id = id;
50     this.version = version;
51   }
52
53   @Override
54   public String getEntityType() {
55     return ENTITY_TYPE;
56   }
57
58   @Override
59   public String getFirstClassCitizenId() {
60     return getId();
61   }
62
63   public String getId() {
64     return id;
65   }
66
67   public void setId(String id) {
68     this.id = id;
69   }
70
71   @Override
72   public Version getVersion() {
73     return version;
74   }
75
76   @Override
77   public void setVersion(Version version) {
78     this.version = version;
79   }
80
81   public String getPackageName() {
82     return packageName;
83   }
84
85   public void setPackageName(String packageName) {
86     this.packageName = packageName;
87   }
88
89   public String getPackageVersion() {
90     return packageVersion;
91   }
92
93   public void setPackageVersion(String packageVersion) {
94     this.packageVersion = packageVersion;
95   }
96
97   public String getValidationData() {
98     return validationData;
99   }
100
101   public void setValidationData(String validationData) {
102     this.validationData = validationData;
103   }
104
105   public ValidationStructureList getValidationDataStructure() {
106     return validationData == null ? null
107         : JsonUtil.json2Object(validationData, ValidationStructureList.class);
108   }
109
110   public void setValidationDataStructure(ValidationStructureList validationData) {
111     this.validationData = validationData == null ? null
112         : JsonUtil.object2Json(validationData);
113   }
114
115   public ByteBuffer getContentData() {
116     return contentData;
117   }
118
119   public void setContentData(ByteBuffer contentData) {
120     this.contentData = contentData;
121   }
122 }