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;
24 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFieldsExtractor;
26 import java.util.ArrayList;
27 import java.util.List;
29 public class ProductMetadataDataDefinition extends ComponentMetadataDataDefinition {
31 private String fullName;
33 private List<String> contacts;
35 private Boolean isActive;
37 public ProductMetadataDataDefinition() {
41 public ProductMetadataDataDefinition(ProductMetadataDataDefinition other) {
45 public ProductMetadataDataDefinition(JsonPresentationFieldsExtractor extractor){
49 public Boolean getIsActive() {
53 public void setIsActive(Boolean active) {
57 public List<String> getContacts() {
61 public void setContacts(List<String> contacts) {
62 this.contacts = contacts;
65 public void addContact(String contact) {
66 if (contact != null) {
67 if (contacts == null) {
68 contacts = new ArrayList<>();
70 contacts.add(contact);
74 public String getFullName() {
78 public void setFullName(String fullName) {
79 this.fullName = fullName;
83 public String toString() {
84 return "ProductMetadataDataDefinition [fullName=" + fullName + ", contacts=" + contacts + ", isActive="
89 public int hashCode() {
91 int result = super.hashCode();
93 result = prime * result + ((contacts == null) ? 0 : contacts.hashCode());
94 result = prime * result + ((fullName == null) ? 0 : fullName.hashCode());
95 result = prime * result + ((isActive == null) ? 0 : isActive.hashCode());
100 public boolean equals(Object obj) {
104 if (!super.equals(obj)) {
107 if (getClass() != obj.getClass()) {
110 ProductMetadataDataDefinition other = (ProductMetadataDataDefinition) obj;
111 if (contacts == null) {
112 if (other.contacts != null) {
115 } else if (!contacts.equals(other.contacts)) {
118 if (fullName == null) {
119 if (other.fullName != null) {
122 } else if (!fullName.equals(other.fullName)) {
125 if (isActive == null) {
126 if (other.isActive != null) {
129 } else if (!isActive.equals(other.isActive)) {
132 return super.equals(obj);
136 public String getActualComponentType() {
137 return getComponentType() != null ? getComponentType().getValue() : null;