Initial OpenECOMP MSO commit
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / VfModule.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * OPENECOMP - MSO
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.openecomp.mso.db.catalog.beans;
22
23
24
25 import java.sql.Timestamp;
26 import java.text.DateFormat;
27
28 import org.openecomp.mso.db.catalog.utils.MavenLikeVersioning;
29
30 public class VfModule extends MavenLikeVersioning {
31         
32         private int id;
33         private Integer vnfResourceId;
34         private String type;
35         private String modelName;
36         private int isBase;
37         private Integer templateId;
38         private Integer environmentId;
39         private Integer volTemplateId;
40         private Integer volEnvironmentId;
41         private String description;
42         private String asdcUuid;
43     private Timestamp created;  
44     private String modelInvariantUuid;
45     private String modelVersion;
46     
47     public VfModule() {
48                 super();
49         }
50         
51         public int getId(){
52                 return this.id;
53         }
54         public void setId(int id) {
55                 this.id = id;
56         }
57         
58         public Integer getVnfResourceId() {
59                 return this.vnfResourceId;
60         }
61         public void setVnfResourceId(Integer vnfResourceId) {
62                 this.vnfResourceId = vnfResourceId;
63         }
64         
65         public String getModelName() {
66                 return this.modelName;
67         }
68         public void setModelName(String modelName) {
69                 this.modelName = modelName;
70         }
71                 
72         public String getType() {
73                 return type;
74         }
75
76         public void setType(String type) {
77                 this.type = type;
78         }
79
80         public int getIsBase() {
81                 return this.isBase;
82         }
83         public void setIsBase(int isBase) {
84                 this.isBase = isBase;
85         }
86         public boolean isBase() {
87                 if (this.isBase == 0) {
88                         return false;
89                 } else {
90                         return true;
91                 }
92         }
93         
94         public Integer getTemplateId() {
95                 return this.templateId;
96         }
97         public void setTemplateId(Integer templateId) {
98                 this.templateId = templateId;
99         }
100         
101         public Integer getEnvironmentId() {
102                 return this.environmentId;
103         }
104         public void setEnvironmentId(Integer environmentId) {
105                 this.environmentId = environmentId;
106         }
107
108         public Integer getVolTemplateId() {
109                 return this.volTemplateId;
110         }
111         public void setVolTemplateId(Integer volTemplateId) {
112                 this.volTemplateId = volTemplateId;
113         }
114         
115         public Integer getVolEnvironmentId() {
116                 return this.volEnvironmentId;
117         }
118         public void setVolEnvironmentId(Integer volEnvironmentId) {
119                 this.volEnvironmentId = volEnvironmentId;
120         }
121         
122         public String getDescription() {
123                 return this.description;
124         }
125         public void setDescription(String description) {
126                 this.description = description;
127         }
128         
129         public String getAsdcUuid() {
130                 return asdcUuid;
131         }
132
133         public void setAsdcUuid(String asdcUuidp) {
134                 this.asdcUuid = asdcUuidp;
135         }
136     
137         public Timestamp getCreated() {
138                 return created;
139         }
140
141         public void setCreated(Timestamp created) {
142                 this.created = created;
143         }
144         public String getModelInvariantUuid() {
145                 return this.modelInvariantUuid;
146         }
147         public void setModelInvariantUuid(String modelInvariantUuid) {
148                 this.modelInvariantUuid = modelInvariantUuid;
149         }
150         
151         
152         public String getModelVersion() {
153                 return this.modelVersion;
154         }
155         public void setModelVersion(String modelVersion) {
156                 this.modelVersion = modelVersion;
157         }
158         
159     @Override
160         public String toString () {
161        StringBuffer buf = new StringBuffer();
162        
163        buf.append("VF=");
164        buf.append(this.type);
165        buf.append(",modelName=");
166        buf.append(modelName);
167        buf.append(",version=");
168        buf.append(version);
169        buf.append(",id=");
170        buf.append(this.id);
171        buf.append(",vnfResourceId=");
172        buf.append(this.vnfResourceId);
173        buf.append(",templateId=");
174        buf.append(this.templateId);
175        buf.append(",envtId=");
176        buf.append(this.environmentId);
177        buf.append(",volTemplateId=");
178        buf.append(this.volTemplateId);
179        buf.append(",volEnvtId=");
180        buf.append(this.volEnvironmentId);
181        buf.append(", description=");
182        buf.append(this.description);
183        buf.append(",asdcUuid=");
184        buf.append(asdcUuid);
185        buf.append(",modelVersion=");
186        buf.append(this.modelVersion);
187        
188          if (this.created != null) {
189                  buf.append (",created=");
190                  buf.append (DateFormat.getInstance().format(this.created));
191          }
192         return buf.toString();
193     }
194         
195 }