Replaced all tabs with spaces in java and pom.xml
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / VnfcCustomization.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 java.util.List;
26 import javax.persistence.CascadeType;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.Id;
30 import javax.persistence.OneToMany;
31 import javax.persistence.PrePersist;
32 import javax.persistence.Table;
33 import javax.persistence.Temporal;
34 import javax.persistence.TemporalType;
35 import com.fasterxml.jackson.annotation.JsonFormat;
36 import com.openpojo.business.annotation.BusinessKey;
37 import org.apache.commons.lang3.builder.HashCodeBuilder;
38 import org.apache.commons.lang3.builder.EqualsBuilder;
39 import org.apache.commons.lang3.builder.ToStringBuilder;
40
41 @Entity
42 @Table(name = "vnfc_customization")
43 public class VnfcCustomization implements Serializable {
44
45     private static final long serialVersionUID = -3772469944364616486L;
46
47     @BusinessKey
48     @Id
49     @Column(name = "MODEL_CUSTOMIZATION_UUID")
50     private String modelCustomizationUUID;
51
52     @Column(name = "MODEL_INSTANCE_NAME")
53     private String modelInstanceName;
54
55     @Column(name = "MODEL_UUID")
56     private String modelUUID;
57
58     @Column(name = "MODEL_INVARIANT_UUID")
59     private String modelInvariantUUID;
60
61     @Column(name = "MODEL_VERSION")
62     private String modelVersion;
63
64     @Column(name = "MODEL_NAME")
65     private String modelName;
66
67     @Column(name = "TOSCA_NODE_TYPE")
68     private String toscaNodeType;
69
70     @Column(name = "DESCRIPTION")
71     private String description;
72
73     @Column(name = "CREATION_TIMESTAMP", updatable = false)
74     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
75     @Temporal(TemporalType.TIMESTAMP)
76     private Date created;
77
78     @OneToMany(cascade = CascadeType.ALL, mappedBy = "vnfcCustomization")
79     private List<CvnfcCustomization> cvnfcCustomization;
80
81     @Override
82     public boolean equals(final Object other) {
83         if (!(other instanceof VnfcCustomization)) {
84             return false;
85         }
86         VnfcCustomization castOther = (VnfcCustomization) other;
87         return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals();
88     }
89
90     @Override
91     public int hashCode() {
92         return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode();
93     }
94
95     @Override
96     public String toString() {
97         return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID)
98                 .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID)
99                 .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion)
100                 .append("modelName", modelName).append("toscaNodeType", toscaNodeType)
101                 .append("description", description).append("created", created)
102                 .append("cvnfcCustomization", cvnfcCustomization).toString();
103     }
104
105     @PrePersist
106     protected void onCreate() {
107         this.created = new Date();
108     }
109
110     public String getModelCustomizationUUID() {
111         return modelCustomizationUUID;
112     }
113
114     public void setModelCustomizationUUID(String modelCustomizationUUID) {
115         this.modelCustomizationUUID = modelCustomizationUUID;
116     }
117
118     public String getModelInstanceName() {
119         return modelInstanceName;
120     }
121
122     public void setModelInstanceName(String modelInstanceName) {
123         this.modelInstanceName = modelInstanceName;
124     }
125
126     public String getModelUUID() {
127         return modelUUID;
128     }
129
130     public void setModelUUID(String modelUUID) {
131         this.modelUUID = modelUUID;
132     }
133
134     public String getModelInvariantUUID() {
135         return modelInvariantUUID;
136     }
137
138     public void setModelInvariantUUID(String modelInvariantUUID) {
139         this.modelInvariantUUID = modelInvariantUUID;
140     }
141
142     public String getModelVersion() {
143         return modelVersion;
144     }
145
146     public void setModelVersion(String modelVersion) {
147         this.modelVersion = modelVersion;
148     }
149
150     public String getModelName() {
151         return modelName;
152     }
153
154     public void setModelName(String modelName) {
155         this.modelName = modelName;
156     }
157
158     public String getToscaNodeType() {
159         return toscaNodeType;
160     }
161
162     public void setToscaNodeType(String toscaNodeType) {
163         this.toscaNodeType = toscaNodeType;
164     }
165
166     public String getDescription() {
167         return description;
168     }
169
170     public void setDescription(String description) {
171         this.description = description;
172     }
173
174     public Date getCreated() {
175         return created;
176     }
177
178     public void setCreated(Date created) {
179         this.created = created;
180     }
181
182     public List<CvnfcCustomization> getCvnfcCustomization() {
183         return cvnfcCustomization;
184     }
185
186     public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) {
187         this.cvnfcCustomization = cvnfcCustomization;
188     }
189 }