2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.openecomp.mso.db.catalog.beans;
\r
23 import java.io.Serializable;
\r
24 import java.sql.Timestamp;
\r
25 import java.text.DateFormat;
\r
27 public class ServiceToResourceCustomization implements Serializable {
\r
29 private static final long serialVersionUID = 768026109321305392L;
\r
31 private String modelType;
\r
32 private String serviceModelUUID;
\r
33 private Timestamp created;
\r
34 private String resourceModelCustomizationUUID;
\r
36 public ServiceToResourceCustomization() {}
\r
38 public String getServiceModelUUID() {
\r
39 return serviceModelUUID;
\r
42 public void setServiceModelUUID(String serviceModelUUID) {
\r
43 this.serviceModelUUID = serviceModelUUID;
\r
46 public String getModelType() {
\r
50 public void setModelType(String modelType) {
\r
51 this.modelType = modelType;
\r
54 public Timestamp getCreated() {
\r
58 public void setCreated(Timestamp created) {
\r
59 this.created = created;
\r
62 public String getResourceModelCustomizationUUID() {
\r
63 return resourceModelCustomizationUUID;
\r
66 public void setResourceModelCustomizationUUID(String resourceModelCustomizationUUID) {
\r
67 this.resourceModelCustomizationUUID = resourceModelCustomizationUUID;
\r
71 public boolean equals(Object o) {
\r
72 if (!(o instanceof ServiceToResourceCustomization)) {
\r
78 ServiceToResourceCustomization strc = (ServiceToResourceCustomization) o;
\r
79 if (strc.getServiceModelUUID().equals(this.getServiceModelUUID())
\r
80 && strc.getResourceModelCustomizationUUID().equals(this.getResourceModelCustomizationUUID())
\r
81 && strc.getModelType().equals(this.getModelType())) {
\r
89 public int hashCode() {
\r
91 int code = this.modelType == null ? 0 : this.modelType.hashCode();
\r
92 code += this.serviceModelUUID == null ? 0 : this.serviceModelUUID.hashCode();
\r
93 code += this.resourceModelCustomizationUUID == null ? 0 : this.resourceModelCustomizationUUID.hashCode();
\r
100 public String toString() {
\r
101 StringBuilder sb = new StringBuilder();
\r
102 sb.append("ServiceToResourceCustomization: modelType=").append(modelType).append(",serviceModelUUID=")
\r
103 .append(serviceModelUUID).append(",resourceModelCustomizationUUID=").append(resourceModelCustomizationUUID);
\r
104 if (created != null) {
\r
105 sb.append (",created=");
\r
106 sb.append (DateFormat.getInstance().format(created));
\r
108 return sb.toString();
\r