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=========================================================
20 package org.openecomp.mso.db.catalog.beans;
22 import java.sql.Timestamp;
24 import com.openpojo.business.annotation.BusinessKey;
26 import java.io.Serializable;
28 public class NetworkResourceCustomization implements Serializable{
30 // modelCustomizationUuid and networkResourceModelUuid form a composite primary key
32 private String modelCustomizationUuid = null;
34 private String networkResourceModelUuid = null;
35 public static final long serialVersionUID = -1322322139926390329L;
36 private String modelInstanceName = null;
37 private Timestamp created = null;
38 private String networkTechnology = null;
39 private String networkType = null;
40 private String networkScope = null;
41 private String networkRole = null;
43 // These fields are not in the table directly - but I'm adding them here for storage in the objects we're dealing with
44 private NetworkResource networkResource = null;
46 public NetworkResourceCustomization() {
50 public String getModelCustomizationUuid() {
51 return this.modelCustomizationUuid;
53 public void setModelCustomizationUuid(String modelCustomizationUuid) {
54 this.modelCustomizationUuid = modelCustomizationUuid;
57 public String getNetworkResourceModelUuid() {
58 return this.networkResourceModelUuid;
60 public void setNetworkResourceModelUuid(String networkResourceModelUuid) {
61 this.networkResourceModelUuid = networkResourceModelUuid;
64 public String getModelInstanceName() {
65 return this.modelInstanceName;
67 public void setModelInstanceName(String modelInstanceName) {
68 this.modelInstanceName = modelInstanceName;
71 public NetworkResource getNetworkResource() {
72 return this.networkResource;
74 public void setNetworkResource(NetworkResource networkResource) {
75 this.networkResource = networkResource;
78 public String getNetworkType() {
79 return this.networkType;
81 public void setNetworkType(String networkType) {
82 this.networkType = networkType;
84 public Timestamp getCreated() {
87 public void setCreated(java.sql.Timestamp timestamp) {
88 this.created = timestamp;
91 public String getNetworkTechnology() {
92 return this.networkTechnology;
94 public void setNetworkTechnology(String networkTechnology) {
95 this.networkTechnology = networkTechnology;
97 public String getNetworkScope() {
98 return this.networkScope;
100 public void setNetworkScope(String networkScope) {
101 this.networkScope = networkScope;
103 public void setNetworkRole(String networkRole) {
104 this.networkRole = networkRole;
106 public String getNetworkRole() {
107 return this.networkRole;
111 public String toString() {
112 return "modelCustomizationUuid=" + this.modelCustomizationUuid +
113 "networkResourceModelUuid=" + this.networkResourceModelUuid +
114 "modelInstanceName=" + this.modelInstanceName +
115 "networkType=" + this.networkType +
116 "networkTechnology=" + this.networkTechnology +
117 "networkScope=" + this.networkScope +
118 "networkRole=" + this.networkRole;
122 public boolean equals (Object o) {
123 if (!(o instanceof NetworkResourceCustomization)) {
129 NetworkResourceCustomization nrc = (NetworkResourceCustomization) o;
130 if (nrc.getModelCustomizationUuid().equals(this.getModelCustomizationUuid())
131 && nrc.getNetworkResourceModelUuid().equals(this.getNetworkResourceModelUuid())) {
138 public int hashCode () {
139 // hash code does not have to be a unique result - only that two objects that should be treated as equal
140 // return the same value. so this should work.
142 result = (this.modelCustomizationUuid != null ? this.modelCustomizationUuid.hashCode() : 0) + (this.networkResourceModelUuid != null ? this.networkResourceModelUuid.hashCode() : 0);