Change the header to SO
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / Model.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.openecomp.mso.db.catalog.beans;
21
22
23 import java.io.Serializable;
24 import java.sql.Timestamp;
25 import java.text.DateFormat;
26 import java.util.Map;
27
28 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
29 public class Model extends MavenLikeVersioning implements Serializable {
30         
31         private static final long serialVersionUID = 768026109321305392L;
32
33         private int id;
34         private String modelCustomizationId;
35         private String modelCustomizationName;
36         private String modelInvariantId;
37         private String modelName;
38         private String modelType;
39         private String modelVersion;
40         private String modelVersionId;
41         private Timestamp created;
42         private Map<String,ServiceRecipe> recipes;
43
44         /**
45          * @return the id
46          */
47         public int getId() {
48                 return id;
49         }
50
51         /**
52          * @param id the id to set
53          */
54         public void setId(int id) {
55                 this.id = id;
56         }
57
58         /**
59          * @return the modelCustomizationId
60          */
61         public String getModelCustomizationId() {
62                 return modelCustomizationId;
63         }
64
65         /**
66          * @param modelCustomizationId the modelCustomizationId to set
67          */
68         public void setModelCustomizationId(String modelCustomizationId) {
69                 this.modelCustomizationId = modelCustomizationId;
70         }
71
72         /**
73          * @return the modelCustomizationName
74          */
75         public String getModelCustomizationName() {
76                 return modelCustomizationName;
77         }
78
79         /**
80          * @param modelCustomizationName the modelCustomizationName to set
81          */
82         public void setModelCustomizationName(String modelCustomizationName) {
83                 this.modelCustomizationName = modelCustomizationName;
84         }
85
86         /**
87          * @return the modelInvariantId
88          */
89         public String getModelInvariantId() {
90                 return modelInvariantId;
91         }
92
93         /**
94          * @param modelInvariantId the modelInvariantId to set
95          */
96         public void setModelInvariantId(String modelInvariantId) {
97                 this.modelInvariantId = modelInvariantId;
98         }
99
100         /**
101          * @return the modelName
102          */
103         public String getModelName() {
104                 return modelName;
105         }
106
107         /**
108          * @param modelName the modelName to set
109          */
110         public void setModelName(String modelName) {
111                 this.modelName = modelName;
112         }
113
114         /**
115          * @return the modelType
116          */
117         public String getModelType() {
118                 return modelType;
119         }
120
121         /**
122          * @param modelType the modelType to set
123          */
124         public void setModelType(String modelType) {
125                 this.modelType = modelType;
126         }
127
128         /**
129          * @return the modelVersion
130          */
131         public String getModelVersion() {
132                 return modelVersion;
133         }
134
135         /**
136          * @param modelVersion the modelVersion to set
137          */
138         public void setModelVersion(String modelVersion) {
139                 this.modelVersion = modelVersion;
140         }
141
142         /**
143          * @return the modelVersionId
144          */
145         public String getModelVersionId() {
146                 return modelVersionId;
147         }
148
149         /**
150          * @param modelVersionId the modelVersionId to set
151          */
152         public void setModelVersionId(String modelVersionId) {
153                 this.modelVersionId = modelVersionId;
154         }
155
156         /**
157          * @return the created
158          */
159         public Timestamp getCreated() {
160                 return created;
161         }
162
163         /**
164          * @param created the created to set
165          */
166         public void setCreated(Timestamp created) {
167                 this.created = created;
168         }
169
170         /**
171          * @return the recipes
172          */
173         public Map<String, ServiceRecipe> getRecipes() {
174                 return recipes;
175         }
176
177         /**
178          * @param recipes the recipes to set
179          */
180         public void setRecipes(Map<String, ServiceRecipe> recipes) {
181                 this.recipes = recipes;
182         }
183
184         @Override
185         public String toString() {
186                 StringBuilder sb = new StringBuilder();
187                 sb.append("Model: ");
188                 sb.append("modelCustomizationId=" + modelCustomizationId);
189                 sb.append(",modelCustomizationName=" + modelCustomizationName);
190                 sb.append(",modelInvariantId=" + modelInvariantId);
191                 sb.append(",modelName=" + modelName);
192                 sb.append(",modelType=" + modelType);
193                 sb.append(",modelVersion=" + modelVersion);
194                 sb.append(",modelVersionId=" + modelVersionId);
195         if (created != null) {
196                 sb.append (",created=");
197                 sb.append (DateFormat.getInstance().format(created));
198             }
199                 return sb.toString();
200         }
201 }