2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.be.datatypes.elements;
23 import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition;
25 import java.util.ArrayList;
26 import java.util.List;
28 public class ProductMetadataDataDefinition extends ComponentMetadataDataDefinition {
30 private String fullName;
32 private List<String> contacts;
34 private Boolean isActive;
36 public ProductMetadataDataDefinition() {
40 public ProductMetadataDataDefinition(ProductMetadataDataDefinition other) {
44 public Boolean getIsActive() {
48 public void setIsActive(Boolean active) {
52 public List<String> getContacts() {
56 public void setContacts(List<String> contacts) {
57 this.contacts = contacts;
60 public void addContact(String contact) {
61 if (contact != null) {
62 if (contacts == null) {
63 contacts = new ArrayList<>();
65 contacts.add(contact);
69 public String getFullName() {
73 public void setFullName(String fullName) {
74 this.fullName = fullName;
78 public String toString() {
79 return "ProductMetadataDataDefinition [fullName=" + fullName + ", contacts=" + contacts + ", isActive="
84 public int hashCode() {
86 int result = super.hashCode();
88 result = prime * result + ((contacts == null) ? 0 : contacts.hashCode());
89 result = prime * result + ((fullName == null) ? 0 : fullName.hashCode());
90 result = prime * result + ((isActive == null) ? 0 : isActive.hashCode());
95 public boolean equals(Object obj) {
98 if (!super.equals(obj))
100 if (getClass() != obj.getClass())
102 ProductMetadataDataDefinition other = (ProductMetadataDataDefinition) obj;
103 if (contacts == null) {
104 if (other.contacts != null)
106 } else if (!contacts.equals(other.contacts))
108 if (fullName == null) {
109 if (other.fullName != null)
111 } else if (!fullName.equals(other.fullName))
113 if (isActive == isActive) {
114 if (other.isActive != null)
116 } else if (!isActive.equals(other.isActive))
118 return super.equals(obj);
122 public String getActualComponentType() {
123 return getComponentType() != null ? getComponentType().getValue() : null;