[SDC] Onboarding 1710 rebase.
[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 / VspDetails.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.util.List;
29
30
31 public class VspDetails implements VersionableEntity {
32   public static final String ENTITY_TYPE = "Vendor Software Product";
33
34   private String id;
35
36   private Version version;
37
38   private String name;
39   private String description;
40
41   private String category;
42
43   private String subCategory;
44
45   private String icon;
46
47   private String vendorName;
48
49   private String vendorId;
50
51   private Version vlmVersion;
52
53   private String licenseAgreement;
54
55   private List<String> featureGroups;
56
57   private String validationData;
58
59   private String oldVersion;
60
61   private Long writetimeMicroSeconds;
62
63   private String onboardingMethod;
64   public VspDetails() {
65   }
66
67   public VspDetails(String id, Version version) {
68     this.id = id;
69     this.version = version;
70   }
71
72   @Override
73   public String getEntityType() {
74     return ENTITY_TYPE;
75   }
76
77   @Override
78   public String getFirstClassCitizenId() {
79     return getId();
80   }
81
82   public String getId() {
83     return id;
84   }
85
86   public void setId(String id) {
87     this.id = id;
88   }
89
90   @Override
91   public Version getVersion() {
92     return version;
93   }
94
95   @Override
96   public void setVersion(Version version) {
97     this.version = version;
98   }
99
100   public String getName() {
101     return name;
102   }
103
104   public void setName(String name) {
105     this.name = name;
106   }
107
108   public String getDescription() {
109     return description;
110   }
111
112   public void setDescription(String description) {
113     this.description = description;
114   }
115
116   public String getCategory() {
117     return category;
118   }
119
120   public void setCategory(String category) {
121     this.category = category;
122   }
123
124   public String getSubCategory() {
125     return subCategory;
126   }
127
128   public void setSubCategory(String subCategory) {
129     this.subCategory = subCategory;
130   }
131
132   public String getIcon() {
133     return icon;
134   }
135
136   public void setIcon(String icon) {
137     this.icon = icon;
138   }
139
140   public String getVendorName() {
141     return vendorName;
142   }
143
144   public void setVendorName(String vendorName) {
145     this.vendorName = vendorName;
146   }
147
148   public String getVendorId() {
149     return vendorId;
150   }
151
152   public void setVendorId(String vendorId) {
153     this.vendorId = vendorId;
154   }
155
156   public Version getVlmVersion() {
157     return vlmVersion;
158   }
159
160   public void setVlmVersion(Version vlmVersion) {
161     this.vlmVersion = vlmVersion;
162   }
163
164   public String getLicenseAgreement() {
165     return licenseAgreement;
166   }
167
168   public void setLicenseAgreement(String licenseAgreement) {
169     this.licenseAgreement = licenseAgreement;
170   }
171
172   public List<String> getFeatureGroups() {
173     return featureGroups;
174   }
175
176   public void setFeatureGroups(List<String> featureGroups) {
177     this.featureGroups = featureGroups;
178   }
179
180   public String getValidationData() {
181     return validationData;
182   }
183
184   public void setValidationData(String validationData) {
185     this.validationData = validationData;
186   }
187
188   public ValidationStructureList getValidationDataStructure() {
189     return validationData == null ? null
190         : JsonUtil.json2Object(validationData, ValidationStructureList.class);
191   }
192
193   public void setValidationDataStructure(ValidationStructureList validationData) {
194     this.validationData = validationData == null ? null
195         : JsonUtil.object2Json(validationData);
196   }
197
198   public Long getWritetimeMicroSeconds() {
199     return this.writetimeMicroSeconds;
200   }
201
202   public void setWritetimeMicroSeconds(Long writetimeMicroSeconds) {
203     this.writetimeMicroSeconds = writetimeMicroSeconds;
204   }
205
206   /*public boolean isOldVersion() {
207     return this.oldVersion;
208   }*/
209
210   public String getOldVersion(){
211     return this.oldVersion;
212   }
213
214   public void setOldVersion(String oldVersion) {
215     this.oldVersion = oldVersion;
216   }
217
218   public String getOnboardingMethod() {
219     return onboardingMethod;
220   }
221   public void setOnboardingMethod(String onboardingMethod) {
222     this.onboardingMethod = onboardingMethod;
223   }
224   @Override
225   public String toString() {
226     return String.format(
227         "Vsp id = '%s', Version = %s', Name = %s', Category = %s', Description = %s', Vendor = %s'",
228         this.id, this.version, this.name, this.category, this.description, this.vendorName);
229   }
230 }