2a4c83b2aaf0b823ed033643b7b5a393bfea0cbb
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / aaiTree / VfModule.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 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.vid.model.aaiTree;
22
23 import org.onap.vid.aai.util.AAITreeConverter;
24
25 import static org.onap.vid.aai.util.AAITreeConverter.IS_BASE_VF_MODULE;
26
27 public class VfModule extends Node {
28
29     private boolean isBase;
30     private String volumeGroupName;
31
32     public VfModule(AAITreeNode node) {
33         super(node, AAITreeConverter.ModelType.vfModule);
34     }
35
36     public boolean getIsBase() {
37         return isBase;
38     }
39
40     public void setIsBase(boolean isBase) {
41         this.isBase = isBase;
42     }
43
44     public String getVolumeGroupName() {
45         return volumeGroupName;
46     }
47
48     public void setVolumeGroupName(String volumeGroupName) {
49         this.volumeGroupName = volumeGroupName;
50     }
51
52     public static VfModule from(AAITreeNode node) {
53         VfModule vfModule = new VfModule(node);
54
55         if (node.getAdditionalProperties().get(IS_BASE_VF_MODULE) != null) {
56             vfModule.setIsBase(Boolean.valueOf(node.getAdditionalProperties().get(IS_BASE_VF_MODULE).toString()));
57         }
58
59         return vfModule;
60     }
61 }