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