[VID-6] Initial rebase push
[vid.git] / vid-app-common / src / main / java / org / openecomp / vid / model / VolumeGroup.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * VID\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.openecomp.vid.model;\r
22 \r
23 import org.openecomp.vid.asdc.beans.tosca.Group;\r
24 \r
25 /**\r
26  * The Class VolumeGroup.\r
27  */\r
28 public class VolumeGroup {\r
29 \r
30         /** The uuid. */\r
31         private String uuid;\r
32         \r
33         /** The invariant uuid. */\r
34         private String invariantUuid;\r
35         \r
36         /** The description. */\r
37         private String description;\r
38         \r
39         /** The name. */\r
40         private String name;\r
41         \r
42         /** The version. */\r
43         private String version;\r
44         \r
45         /** The customization uuid. */\r
46         private String customizationUuid;\r
47         \r
48         /** The customization uuid. */\r
49         private String modelCustomizationName;\r
50         /**\r
51          * Instantiates a new volume group.\r
52          */\r
53         public VolumeGroup() {}\r
54 \r
55         /**\r
56          * Gets the uuid.\r
57          *\r
58          * @return the uuid\r
59          */\r
60         public String getUuid() {\r
61                 return uuid;\r
62         }\r
63         /**\r
64          * Gets the customization uuid.\r
65          *\r
66          * @return the customization uuid\r
67          */\r
68         public String getCustomizationUuid() {\r
69                 return customizationUuid;\r
70         }\r
71         /**\r
72          * Gets the customization name.\r
73          *\r
74          * @return the customization name\r
75          */\r
76         public String getModelCustomizationName() {\r
77                 return modelCustomizationName;\r
78         }\r
79         /**\r
80          * Gets the invariant uuid.\r
81          *\r
82          * @return the invariant uuid\r
83          */\r
84         public String getInvariantUuid() {\r
85                 return invariantUuid;\r
86         }\r
87 \r
88         /**\r
89          * Gets the description.\r
90          *\r
91          * @return the description\r
92          */\r
93         public String getDescription() {\r
94                 return description;\r
95         }\r
96 \r
97         /**\r
98          * Gets the name.\r
99          *\r
100          * @return the name\r
101          */\r
102         public String getName() {\r
103                 return name;\r
104         }\r
105 \r
106         /**\r
107          * Gets the version.\r
108          *\r
109          * @return the version\r
110          */\r
111         public String getVersion() {\r
112                 return version;\r
113         }\r
114 \r
115         /**\r
116          * Sets the uuid.\r
117          *\r
118          * @param uuid the new uuid\r
119          */\r
120         public void setUuid(String uuid) {\r
121                 this.uuid = uuid;\r
122         }\r
123 \r
124         /**\r
125          * Sets the invariant uuid.\r
126          *\r
127          * @param invariantUuid the new invariant uuid\r
128          */\r
129         public void setInvariantUuid(String invariantUuid) {\r
130                 this.invariantUuid = invariantUuid;\r
131         }\r
132 \r
133         /**\r
134          * Sets the description.\r
135          *\r
136          * @param description the new description\r
137          */\r
138         public void setDescription(String description) {\r
139                 this.description = description;\r
140         }\r
141 \r
142         /**\r
143          * Sets the name.\r
144          *\r
145          * @param name the new name\r
146          */\r
147         public void setName(String name) {\r
148                 this.name = name;\r
149         }\r
150 \r
151         /**\r
152          * Sets the version.\r
153          *\r
154          * @param version the new version\r
155          */\r
156         public void setVersion(String version) {\r
157                 this.version = version;\r
158         }\r
159         /**\r
160          * Sets the customization uuid.\r
161          *\r
162          * @param u the new customization uuid\r
163          */\r
164         private void setCustomizationUuid(String u) {\r
165                 this.customizationUuid = u;\r
166                 \r
167         }\r
168         /**\r
169          * Sets the customization name.\r
170          *\r
171          * @param u the new customization name\r
172          */\r
173         private void setModelCustomizationName(String u) {\r
174                 this.modelCustomizationName = u;\r
175                 \r
176         }\r
177         /**\r
178          * Extract volume group.\r
179          *\r
180          * @param group the group\r
181          * @return the volume group\r
182          */\r
183         public static VolumeGroup extractVolumeGroup(String modelCustomizationName, Group group) {\r
184                 final VolumeGroup volumeGroup = new VolumeGroup();\r
185                 \r
186                 volumeGroup.setUuid(group.getMetadata().getVfModuleModelUUID());\r
187                 volumeGroup.setInvariantUuid(group.getMetadata().getVfModuleModelInvariantUUID());\r
188                 volumeGroup.setDescription(group.getMetadata().getDescription());\r
189                 volumeGroup.setName(group.getMetadata().getVfModuleModelName());\r
190                 volumeGroup.setVersion(group.getMetadata().getVfModuleModelVersion());\r
191                 volumeGroup.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());\r
192                 volumeGroup.setModelCustomizationName(modelCustomizationName);\r
193                 return volumeGroup;\r
194         }\r
195 \r
196 }\r