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