Replaced all tabs with spaces in java and pom.xml
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / VnfRecipe.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.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.Id;
28 import javax.persistence.PrePersist;
29 import javax.persistence.Table;
30 import javax.persistence.Temporal;
31 import javax.persistence.TemporalType;
32 import org.apache.commons.lang3.builder.EqualsBuilder;
33 import org.apache.commons.lang3.builder.HashCodeBuilder;
34 import org.apache.commons.lang3.builder.ToStringBuilder;
35 import com.openpojo.business.annotation.BusinessKey;
36
37 @Entity
38 @Table(name = "vnf_recipe")
39 public class VnfRecipe implements Serializable, Recipe {
40
41     private static final long serialVersionUID = 768026109321305392L;
42
43     @Id
44     @Column(name = "id")
45     private Integer id;
46
47     @BusinessKey
48     @Column(name = "NF_ROLE")
49     private String nfRole;
50
51     @Column(name = "VNF_PARAM_XSD")
52     private String paramXsd;
53
54     @Column(name = "VF_MODULE_ID")
55     private String vfModuleId;
56
57     @BusinessKey
58     @Column(name = "ACTION")
59     protected String action;
60
61     @Column(name = "description")
62     private String description;
63
64     @BusinessKey
65     @Column(name = "ORCHESTRATION_URI")
66     protected String orchestrationUri;
67
68     @Column(name = "RECIPE_TIMEOUT")
69     private Integer recipeTimeout;
70
71     @Column(name = "VERSION_STR")
72     private String versionStr;
73
74     @BusinessKey
75     @Column(name = "SERVICE_TYPE")
76     private String serviceType;
77
78     @Column(name = "CREATION_TIMESTAMP", updatable = false)
79     @Temporal(TemporalType.TIMESTAMP)
80     private Date created;
81
82     @PrePersist
83     protected void onCreate() {
84         this.created = new Date();
85     }
86
87     @Override
88     public String toString() {
89         return new ToStringBuilder(this).append("id", id).append("vnfType", nfRole).append("paramXsd", paramXsd)
90                 .append("vfModuleId", vfModuleId).append("action", action).append("description", description)
91                 .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout)
92                 .append("serviceType", serviceType).append("created", created).toString();
93     }
94
95     @Override
96     public boolean equals(final Object other) {
97         if (!(other instanceof VnfRecipe)) {
98             return false;
99         }
100         VnfRecipe castOther = (VnfRecipe) other;
101         return new EqualsBuilder().append(nfRole, castOther.nfRole).append(action, castOther.action)
102                 .append(orchestrationUri, castOther.orchestrationUri).append(serviceType, castOther.serviceType)
103                 .isEquals();
104     }
105
106     @Override
107     public int hashCode() {
108         return new HashCodeBuilder().append(nfRole).append(action).append(orchestrationUri).append(serviceType)
109                 .toHashCode();
110     }
111
112     public String getNfRole() {
113         return nfRole;
114     }
115
116     public void setNfRole(String nfRole) {
117         this.nfRole = nfRole;
118     }
119
120     public String getParamXsd() {
121         return paramXsd;
122     }
123
124     public void setParamXsd(String paramXsd) {
125         this.paramXsd = paramXsd;
126     }
127
128     public String getVfModuleId() {
129         return vfModuleId;
130     }
131
132     public void setVfModuleId(String vfModuleId) {
133         this.vfModuleId = vfModuleId;
134     }
135
136     public Integer getId() {
137         return id;
138     }
139
140     public void setId(Integer id) {
141         this.id = id;
142     }
143
144     public String getAction() {
145         return action;
146     }
147
148     public void setAction(String action) {
149         this.action = action;
150     }
151
152     public String getDescription() {
153         return description;
154     }
155
156     public void setDescription(String description) {
157         this.description = description;
158     }
159
160     public String getOrchestrationUri() {
161         return orchestrationUri;
162     }
163
164     public void setOrchestrationUri(String orchestrationUri) {
165         this.orchestrationUri = orchestrationUri;
166     }
167
168     public Integer getRecipeTimeout() {
169         return recipeTimeout;
170     }
171
172     public void setRecipeTimeout(Integer recipeTimeout) {
173         this.recipeTimeout = recipeTimeout;
174     }
175
176     public String getServiceType() {
177         return serviceType;
178     }
179
180     public void setServiceType(String serviceType) {
181         this.serviceType = serviceType;
182     }
183
184     public Date getCreated() {
185         return created;
186     }
187
188     public String getVersionStr() {
189         return versionStr;
190     }
191
192     public void setVersionStr(String versionStr) {
193         this.versionStr = versionStr;
194     }
195 }