Reformat catalog-model
[sdc.git] / catalog-model / src / main / java / org / openecomp / sdc / be / ui / model / UiComponentMetadata.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 package org.openecomp.sdc.be.ui.model;
21
22 import java.util.List;
23 import java.util.Map;
24 import lombok.Getter;
25 import lombok.Setter;
26 import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition;
27 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
28 import org.openecomp.sdc.be.model.category.CategoryDefinition;
29
30 @Getter
31 @Setter
32 public abstract class UiComponentMetadata {
33
34     private String uniqueId;
35     private String name; // archiveName
36
37     private String version; // archiveVersion
38     private Boolean isHighestVersion;
39     private Long creationDate;
40     private Long lastUpdateDate;
41     private String description;
42     private String lifecycleState;
43     private List<String> tags;
44     private String icon;
45     private String UUID;
46     private String normalizedName;
47     private String systemName;
48     private String contactId;
49     private Map<String, String> allVersions;
50     private Boolean isDeleted;
51     private String projectCode;
52     private String csarUUID;
53     private String csarVersion;
54     private String importedToscaChecksum;
55     private String invariantUUID;
56     private ComponentTypeEnum componentType;
57     private List<CategoryDefinition> categories;
58     private String creatorUserId;
59     private String creatorFullName;
60     private String lastUpdaterUserId;
61     private String lastUpdaterFullName;
62     //Archive/Restore
63     private Boolean isArchived;
64     private Long archiveTime;
65     private Boolean isVspArchived;
66
67     public UiComponentMetadata() {
68     }
69
70     public UiComponentMetadata(List<CategoryDefinition> categories, ComponentMetadataDataDefinition metadata) {
71         this.uniqueId = metadata.getUniqueId();
72         this.name = metadata.getName(); // archiveName
73         this.version = metadata.getVersion();
74         this.isHighestVersion = metadata.isHighestVersion();
75         this.creationDate = metadata.getCreationDate();
76         this.lastUpdateDate = metadata.getLastUpdateDate();
77         this.description = metadata.getDescription();
78         this.lifecycleState = metadata.getState();
79         this.tags = metadata.getTags();
80         this.icon = metadata.getIcon();
81         this.UUID = metadata.getUUID();
82         this.normalizedName = metadata.getNormalizedName();
83         this.systemName = metadata.getSystemName();
84         this.contactId = metadata.getContactId();
85         this.allVersions = metadata.getAllVersions();
86         this.projectCode = metadata.getProjectCode();
87         this.csarUUID = metadata.getCsarUUID();
88         this.csarVersion = metadata.getCsarVersion();
89         this.importedToscaChecksum = metadata.getImportedToscaChecksum();
90         this.invariantUUID = metadata.getInvariantUUID();
91         this.componentType = metadata.getComponentType();
92         this.categories = categories;
93         this.creatorUserId = metadata.getCreatorUserId();
94         this.creatorFullName = metadata.getCreatorFullName();
95         this.lastUpdaterFullName = metadata.getLastUpdaterFullName();
96         this.lastUpdaterUserId = metadata.getLastUpdaterUserId();
97         //archive
98         this.isArchived = metadata.isArchived();
99         this.archiveTime = metadata.getArchiveTime();
100         this.isVspArchived = metadata.isVspArchived();
101     }
102 }