Reformat common-be
[sdc.git] / common-be / src / main / java / org / openecomp / sdc / be / datatypes / elements / ProductMetadataDataDefinition.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.datatypes.elements;
21
22 import java.util.ArrayList;
23 import java.util.List;
24 import lombok.EqualsAndHashCode;
25 import lombok.Getter;
26 import lombok.NoArgsConstructor;
27 import lombok.Setter;
28 import lombok.ToString;
29 import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition;
30 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFieldsExtractor;
31
32 @Getter
33 @Setter
34 @NoArgsConstructor
35 @EqualsAndHashCode(callSuper = true)
36 @ToString
37 public class ProductMetadataDataDefinition extends ComponentMetadataDataDefinition {
38
39     private String fullName;
40     private List<String> contacts;
41     private Boolean isActive;
42
43     public ProductMetadataDataDefinition(JsonPresentationFieldsExtractor extractor) {
44         super(extractor);
45     }
46
47     public Boolean getIsActive() {
48         return isActive;
49     }
50
51     public void setIsActive(Boolean active) {
52         isActive = active;
53     }
54
55     public void addContact(String contact) {
56         if (contact != null) {
57             if (contacts == null) {
58                 contacts = new ArrayList<>();
59             }
60             contacts.add(contact);
61         }
62     }
63
64     @Override
65     public String getActualComponentType() {
66         return getComponentType() != null ? getComponentType().getValue() : null;
67     }
68 }