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.mso.db.catalog.beans;
23 import java.io.Serializable;
24 import java.sql.Timestamp;
25 import java.text.DateFormat;
27 import org.apache.commons.lang3.builder.EqualsBuilder;
29 import com.openpojo.business.annotation.BusinessKey;
31 public class ServiceToResourceCustomization implements Serializable {
33 private static final long serialVersionUID = 768026109321305392L;
36 private String modelType = null;
38 private String serviceModelUUID = null;
39 private Timestamp created = null;
41 private String resourceModelCustomizationUUID = null;
43 public ServiceToResourceCustomization() {}
45 public String getServiceModelUUID() {
46 return serviceModelUUID;
49 public void setServiceModelUUID(String serviceModelUUID) {
50 this.serviceModelUUID = serviceModelUUID;
53 public String getModelType() {
57 public void setModelType(String modelType) {
58 this.modelType = modelType;
61 public Timestamp getCreated() {
65 public void setCreated(Timestamp created) {
66 this.created = created;
69 public String getResourceModelCustomizationUUID() {
70 return resourceModelCustomizationUUID;
73 public void setResourceModelCustomizationUUID(String resourceModelCustomizationUUID) {
74 this.resourceModelCustomizationUUID = resourceModelCustomizationUUID;
79 public boolean equals (final Object other) {
80 if (!(other instanceof ServiceToResourceCustomization)) {
83 ServiceToResourceCustomization castOther = (ServiceToResourceCustomization) other;
84 return new EqualsBuilder().append(modelType, castOther.modelType)
85 .append(serviceModelUUID, castOther.serviceModelUUID)
86 .append(resourceModelCustomizationUUID, castOther.resourceModelCustomizationUUID).isEquals();
90 public int hashCode() {
92 int code = this.modelType == null ? 0 : this.modelType.hashCode();
93 code += this.serviceModelUUID == null ? 0 : this.serviceModelUUID.hashCode();
94 code += this.resourceModelCustomizationUUID == null ? 0 : this.resourceModelCustomizationUUID.hashCode();
99 public String toString() {
100 StringBuilder sb = new StringBuilder();
101 sb.append("ServiceToResourceCustomization: modelType=").append(modelType).append(",serviceModelUUID=")
102 .append(serviceModelUUID).append(",resourceModelCustomizationUUID=").append(resourceModelCustomizationUUID);
103 if (created != null) {
104 sb.append (",created=");
105 sb.append (DateFormat.getInstance().format(created));
107 return sb.toString();