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.io.Serializable;
26 import java.util.ArrayList;
27 import java.util.List;
29 public class ProductMetadataDataDefinition extends ComponentMetadataDataDefinition implements Serializable {
34 private static final long serialVersionUID = -1877577227290771160L;
36 private String fullName;
38 private List<String> contacts;
40 private Boolean isActive;
42 public ProductMetadataDataDefinition() {
46 public ProductMetadataDataDefinition(ProductMetadataDataDefinition other) {
50 public Boolean getIsActive() {
54 public void setIsActive(Boolean active) {
58 public List<String> getContacts() {
62 public void setContacts(List<String> contacts) {
63 this.contacts = contacts;
66 public void addContact(String contact) {
67 if (contact != null) {
68 if (contacts == null) {
69 contacts = new ArrayList<>();
71 contacts.add(contact);
75 public String getFullName() {
79 public void setFullName(String fullName) {
80 this.fullName = fullName;
84 public String toString() {
85 return "ProductMetadataDataDefinition [fullName=" + fullName + ", contacts=" + contacts + ", isActive="
90 public int hashCode() {
92 int result = super.hashCode();
94 result = prime * result + ((contacts == null) ? 0 : contacts.hashCode());
95 result = prime * result + ((fullName == null) ? 0 : fullName.hashCode());
96 result = prime * result + ((isActive == null) ? 0 : isActive.hashCode());
101 public boolean equals(Object obj) {
104 if (!super.equals(obj))
106 if (getClass() != obj.getClass())
108 ProductMetadataDataDefinition other = (ProductMetadataDataDefinition) obj;
109 if (contacts == null) {
110 if (other.contacts != null)
112 } else if (!contacts.equals(other.contacts))
114 if (fullName == null) {
115 if (other.fullName != null)
117 } else if (!fullName.equals(other.fullName))
119 if (isActive == isActive) {
120 if (other.isActive != null)
122 } else if (!isActive.equals(other.isActive))
124 return super.equals(obj);
128 public String getActualComponentType() {
129 return getComponentType().getValue();