Replaced all tabs with spaces in java and pom.xml
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / NetworkResourceCustomization.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.so.db.catalog.beans;
22
23 import java.io.Serializable;
24 import java.util.Date;
25 import javax.persistence.CascadeType;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.FetchType;
29 import javax.persistence.Id;
30 import javax.persistence.JoinColumn;
31 import javax.persistence.ManyToOne;
32 import javax.persistence.PrePersist;
33 import javax.persistence.Table;
34 import javax.persistence.Temporal;
35 import javax.persistence.TemporalType;
36 import org.apache.commons.lang3.builder.EqualsBuilder;
37 import org.apache.commons.lang3.builder.HashCodeBuilder;
38 import org.apache.commons.lang3.builder.ToStringBuilder;
39 import com.openpojo.business.annotation.BusinessKey;
40 import uk.co.blackpepper.bowman.annotation.LinkedResource;
41
42 @Entity
43 @Table(name = "network_resource_customization")
44 public class NetworkResourceCustomization implements Serializable {
45     public static final long serialVersionUID = -1322322139926390329L;
46
47     @Override
48     public String toString() {
49         return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
50                 .append("modelInstanceName", modelInstanceName).append("created", created)
51                 .append("networkTechnology", networkTechnology).append("networkType", networkType)
52                 .append("networkScope", networkScope).append("networkRole", networkRole)
53                 .append("networkResource", networkResource).toString();
54     }
55
56     @Override
57     public boolean equals(final Object other) {
58         if (!(other instanceof NetworkResourceCustomization)) {
59             return false;
60         }
61         NetworkResourceCustomization castOther = (NetworkResourceCustomization) other;
62         return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
63     }
64
65     @Override
66     public int hashCode() {
67         return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
68     }
69
70     public NetworkResourceCustomization() {
71         super();
72     }
73
74     @BusinessKey
75     @Id
76     @Column(name = "MODEL_CUSTOMIZATION_UUID")
77     private String modelCustomizationUUID = null;
78
79     @Column(name = "MODEL_INSTANCE_NAME")
80     private String modelInstanceName;
81
82     @Column(name = "CREATION_TIMESTAMP", updatable = false)
83     @Temporal(TemporalType.TIMESTAMP)
84     private Date created;
85
86     @Column(name = "NETWORK_TECHNOLOGY")
87     private String networkTechnology;
88
89     @Column(name = "NETWORK_TYPE")
90     private String networkType = null;
91
92     @Column(name = "NETWORK_SCOPE")
93     private String networkScope;
94
95     @Column(name = "NETWORK_ROLE")
96     private String networkRole;
97
98     @Column(name = "RESOURCE_INPUT")
99     private String resourceInput;
100
101     @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
102     @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID")
103     private NetworkResource networkResource = null;
104
105     @PrePersist
106     protected void onCreate() {
107         this.created = new Date();
108     }
109
110     public String getModelCustomizationUUID() {
111         return this.modelCustomizationUUID;
112     }
113
114     public void setModelCustomizationUUID(String modelCustomizationUUID) {
115         this.modelCustomizationUUID = modelCustomizationUUID;
116     }
117
118     public String getModelInstanceName() {
119         return this.modelInstanceName;
120     }
121
122     public void setModelInstanceName(String modelInstanceName) {
123         this.modelInstanceName = modelInstanceName;
124     }
125
126     @LinkedResource
127     public NetworkResource getNetworkResource() {
128         return this.networkResource;
129     }
130
131     public void setNetworkResource(NetworkResource networkResource) {
132         this.networkResource = networkResource;
133     }
134
135     public String getNetworkType() {
136         return this.networkType;
137     }
138
139     public void setNetworkType(String networkType) {
140         this.networkType = networkType;
141     }
142
143     public Date getCreated() {
144         return this.created;
145     }
146
147     public String getNetworkTechnology() {
148         return this.networkTechnology;
149     }
150
151     public void setNetworkTechnology(String networkTechnology) {
152         this.networkTechnology = networkTechnology;
153     }
154
155     public String getNetworkScope() {
156         return this.networkScope;
157     }
158
159     public void setNetworkScope(String networkScope) {
160         this.networkScope = networkScope;
161     }
162
163     public void setNetworkRole(String networkRole) {
164         this.networkRole = networkRole;
165     }
166
167     public String getNetworkRole() {
168         return this.networkRole;
169     }
170
171     public String getResourceInput() {
172         return resourceInput;
173     }
174
175     public void setResourceInput(String resourceInput) {
176         this.resourceInput = resourceInput;
177     }
178 }