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;
23 import java.io.Serializable;
25 public class NetworkResourceCustomization implements Serializable{
27 // modelCustomizationUuid and networkResourceModelUuid form a composite primary key
28 private String modelCustomizationUuid = null;
29 private String networkResourceModelUuid = null;
30 public static final long serialVersionUID = -1322322139926390329L;
31 private String modelInstanceName;
32 private Timestamp created;
33 private String networkTechnology;
34 private String networkType = null;
35 private String networkScope;
36 private String networkRole;
38 // These fields are not in the table directly - but I'm adding them here for storage in the objects we're dealing with
39 private NetworkResource networkResource = null;
41 public NetworkResourceCustomization() {
45 public String getModelCustomizationUuid() {
46 return this.modelCustomizationUuid;
48 public void setModelCustomizationUuid(String modelCustomizationUuid) {
49 this.modelCustomizationUuid = modelCustomizationUuid;
52 public String getNetworkResourceModelUuid() {
53 return this.networkResourceModelUuid;
55 public void setNetworkResourceModelUuid(String networkResourceModelUuid) {
56 this.networkResourceModelUuid = networkResourceModelUuid;
59 public String getModelInstanceName() {
60 return this.modelInstanceName;
62 public void setModelInstanceName(String modelInstanceName) {
63 this.modelInstanceName = modelInstanceName;
66 public NetworkResource getNetworkResource() {
67 return this.networkResource;
69 public void setNetworkResource(NetworkResource networkResource) {
70 this.networkResource = networkResource;
73 public String getNetworkType() {
74 return this.networkType;
76 public void setNetworkType(String networkType) {
77 this.networkType = networkType;
79 public Timestamp getCreated() {
82 public void setCreated(java.sql.Timestamp timestamp) {
83 this.created = timestamp;
86 public String getNetworkTechnology() {
87 return this.networkTechnology;
89 public void setNetworkTechnology(String networkTechnology) {
90 this.networkTechnology = networkTechnology;
92 public String getNetworkScope() {
93 return this.networkScope;
95 public void setNetworkScope(String networkScope) {
96 this.networkScope = networkScope;
98 public void setNetworkRole(String networkRole) {
99 this.networkRole = networkRole;
101 public String getNetworkRole() {
102 return this.networkRole;
106 public String toString () {
107 StringBuffer sb = new StringBuffer();
108 sb.append("modelCustomizationUuid=");
109 sb.append(this.modelCustomizationUuid);
110 sb.append("networkResourceModelUuid=");
111 sb.append(this.networkResourceModelUuid);
112 sb.append("modelInstanceName=");
113 sb.append(this.modelInstanceName);
114 sb.append("networkType=");
115 sb.append(this.networkType);
116 sb.append("networkTechnology=");
117 sb.append(this.networkTechnology);
118 sb.append("networkScope=");
119 sb.append(this.networkScope);
120 sb.append("networkRole=");
121 sb.append(this.networkRole);
123 return sb.toString();
127 public boolean equals (Object o) {
128 if (!(o instanceof NetworkResourceCustomization)) {
134 NetworkResourceCustomization nrc = (NetworkResourceCustomization) o;
135 if (nrc.getModelCustomizationUuid().equals(this.getModelCustomizationUuid())
136 && nrc.getNetworkResourceModelUuid().equals(this.getNetworkResourceModelUuid())) {
143 public int hashCode () {
144 // hash code does not have to be a unique result - only that two objects that should be treated as equal
145 // return the same value. so this should work.
147 result = (this.modelCustomizationUuid != null ? this.modelCustomizationUuid.hashCode() : 0) + (this.networkResourceModelUuid != null ? this.networkResourceModelUuid.hashCode() : 0);