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