[SO] Release so 1.13.0 image
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / VnfComponentsRecipe.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 javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.GeneratedValue;
27 import javax.persistence.GenerationType;
28 import javax.persistence.Id;
29 import javax.persistence.Table;
30 import org.apache.commons.lang3.builder.EqualsBuilder;
31 import org.apache.commons.lang3.builder.HashCodeBuilder;
32 import org.apache.commons.lang3.builder.ToStringBuilder;
33 import com.openpojo.business.annotation.BusinessKey;
34 import uk.co.blackpepper.bowman.annotation.RemoteResource;
35
36 @Entity
37 @RemoteResource("/vnfComponentsRecipe")
38 @Table(name = "vnf_components_recipe")
39 public class VnfComponentsRecipe implements Serializable, Recipe {
40
41     private static final long serialVersionUID = 768026109321305392L;
42
43     @Id
44     @Column(name = "id")
45     @GeneratedValue(strategy = GenerationType.IDENTITY)
46     private Integer id;
47
48     @BusinessKey
49     @Column(name = "ACTION")
50     private String action;
51
52     @Column(name = "DESCRIPTION")
53     private String description;
54
55     @BusinessKey
56     @Column(name = "ORCHESTRATION_URI")
57     private String orchestrationUri;
58
59     @Column(name = "RECIPE_TIMEOUT")
60     private Integer recipeTimeout;
61
62     @BusinessKey
63     @Column(name = "VNF_TYPE")
64     private String vnfType;
65
66     @Column(name = "VNF_COMPONENT_PARAM_XSD")
67     private String paramXsd;
68
69     @Column(name = "VNF_COMPONENT_TYPE")
70     private String vnfComponentType;
71
72     @BusinessKey
73     @Column(name = "VF_MODULE_MODEL_UUID")
74     private String vfModuleModelUUID;
75
76     @Override
77     public String toString() {
78         return new ToStringBuilder(this).append("id", id).append("action", action).append("description", description)
79                 .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout)
80                 .append("vnfType", vnfType).append("paramXsd", paramXsd).append("vnfComponentType", vnfComponentType)
81                 .append("vfModuleModelUUID", vfModuleModelUUID).toString();
82     }
83
84     @Override
85     public boolean equals(final Object other) {
86         if (!(other instanceof VnfComponentsRecipe)) {
87             return false;
88         }
89         VnfComponentsRecipe castOther = (VnfComponentsRecipe) other;
90         return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri)
91                 .append(vnfType, castOther.vnfType).append(vfModuleModelUUID, castOther.vfModuleModelUUID).isEquals();
92     }
93
94     @Override
95     public int hashCode() {
96         return new HashCodeBuilder().append(action).append(orchestrationUri).append(vnfType).append(vfModuleModelUUID)
97                 .toHashCode();
98     }
99
100     @Override
101     public Integer getId() {
102         return id;
103     }
104
105     public void setId(Integer id) {
106         this.id = id;
107     }
108
109     @Override
110     public String getAction() {
111         return action;
112     }
113
114     public void setAction(String action) {
115         this.action = action;
116     }
117
118     @Override
119     public String getDescription() {
120         return description;
121     }
122
123     public void setDescription(String description) {
124         this.description = description;
125     }
126
127     public void setOrchestrationUri(String orchestrationUri) {
128         this.orchestrationUri = orchestrationUri;
129     }
130
131     public void setRecipeTimeout(Integer recipeTimeout) {
132         this.recipeTimeout = recipeTimeout;
133     }
134
135     public String getVnfType() {
136         return vnfType;
137     }
138
139     public void setVnfType(String vnfType) {
140         this.vnfType = vnfType;
141     }
142
143     @Override
144     public String getParamXsd() {
145         return paramXsd;
146     }
147
148     public void setParamXsd(String paramXsd) {
149         this.paramXsd = paramXsd;
150     }
151
152     public String getVnfComponentType() {
153         return vnfComponentType;
154     }
155
156     public void setVnfComponentType(String vnfComponentType) {
157         this.vnfComponentType = vnfComponentType;
158     }
159
160     public String getVfModuleModelUUID() {
161         return vfModuleModelUUID;
162     }
163
164     public void setVfModuleModelUUID(String vfModuleModelUUID) {
165         this.vfModuleModelUUID = vfModuleModelUUID;
166     }
167
168     @Override
169     public String getOrchestrationUri() {
170         return orchestrationUri;
171     }
172
173     @Override
174     public Integer getRecipeTimeout() {
175         return recipeTimeout;
176     }
177 }