Reformat catalog-model
[sdc.git] / catalog-model / src / main / java / org / openecomp / sdc / be / model / catalog / CatalogComponent.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 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.model.catalog;
21
22 import static java.util.Objects.requireNonNull;
23
24 import com.google.common.collect.ImmutableList;
25 import java.util.ArrayList;
26 import java.util.Collections;
27 import java.util.List;
28 import lombok.Getter;
29 import lombok.Setter;
30 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
31 import org.openecomp.sdc.be.model.category.CategoryDefinition;
32
33 @Getter
34 @Setter
35 public class CatalogComponent {
36
37     private String version;
38     private ComponentTypeEnum componentType;
39     private String icon;
40     private String uniqueId;
41     private String lifecycleState;
42     private long lastUpdateDate;
43     private String name;
44     private String resourceType;
45     private String categoryNormalizedName;
46     private String subCategoryNormalizedName;
47     private String distributionStatus;
48     private String uuid;
49     private String invariantUUID;
50     private String systemName;
51     private String description;
52     private List<String> tags;
53     private Boolean isHighestVersion;
54     private String lastUpdaterUserId;
55     private List<CategoryDefinition> categories;
56
57     public List<String> getTags() {
58         return tags == null ? Collections.emptyList() : ImmutableList.copyOf(tags);
59     }
60
61     public void setTags(List<String> tags) {
62         requireNonNull(tags);
63         this.tags = new ArrayList<>(tags);
64     }
65
66     public List<CategoryDefinition> getCategories() {
67         return categories == null ? Collections.emptyList() : ImmutableList.copyOf(categories);
68     }
69 }