Specify a model while creating a VSP
[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  * Modifications Copyright (C) 2021 Nordix Foundation.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
22
23 import java.util.ArrayList;
24 import java.util.Collections;
25 import java.util.List;
26 import lombok.Getter;
27 import lombok.NoArgsConstructor;
28 import lombok.Setter;
29 import org.openecomp.sdc.versioning.dao.types.Version;
30 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
31
32 @Getter
33 @Setter
34 @NoArgsConstructor
35 public class VspDetails implements VersionableEntity {
36
37     public static final String ENTITY_TYPE = "Vendor Software Product";
38     private String id;
39     private Version version;
40     private String name;
41     private String description;
42     private String category;
43     private String subCategory;
44     private String icon;
45     private String vendorName;
46     private String vendorId;
47     private Version vlmVersion;
48     private String licenseType;
49     private String licenseAgreement;
50     private List<String> featureGroups;
51     private String onboardingMethod;
52     private List<String> modelIdList;
53
54     public VspDetails(String id, Version version) {
55         this.id = id;
56         this.version = version;
57     }
58
59     @Override
60     public String getEntityType() {
61         return ENTITY_TYPE;
62     }
63
64     @Override
65     public String getFirstClassCitizenId() {
66         return getId();
67     }
68
69     public List<String> getModelIdList() {
70         if (modelIdList == null) {
71             return Collections.emptyList();
72         }
73         return new ArrayList<>(modelIdList);
74     }
75
76     @Override
77     public String toString() {
78         return String.format("Vsp id = '%s', Version = '%s', Name = '%s', Category = '%s', Description = '%s', Vendor = '%s', Model = '%s'",
79             this.id, this.version, this.name, this.category, this.description, this.vendorName, this.modelIdList);
80     }
81 }