2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Modifications Copyright (c) 2019 Samsung
8 * ================================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=========================================================
23 package org.onap.so.bpmn.common.scripts;
26 public class VfModule implements Serializable {
28 * Class representing a VF Module Node. Fields of this class include indicators
29 * as to whether the VF Module is the only VF Module in its containing Generic VNF
30 * and whether the VF Module is the base VF Module in its containing Generic VNF.
34 private Boolean onlyVfModule
35 private Boolean baseVfModule
40 * @param node Node representing the VF Module xml.
41 * @param onlyVfModule Is this VF Module the only VF Module in its containing Generic VNF?
43 public VfModule(Node node, boolean onlyVfModule) {
45 this.onlyVfModule = onlyVfModule
46 this.baseVfModule = getElementText('is-base-vf-module').equals('true')
50 * Get the Node representing the VF Module xml.
52 * @return the Node representing the VF Module xml.
54 public Node getNode() {
58 public String getElementText(String childNodeName) {
59 def Node childNode = (new MsoUtils()).getChildNode(node, childNodeName)
60 if (childNode == null) {
63 return childNode.text()
68 * Is this VF Module the only VF Module in its containing Generic VNF?
70 * @return true if this VF Module is the only VF Module in its containing Generic VNF;
73 public boolean isOnlyVfModule() {
78 * Is this VF Module the base VF Module in its containing Generic VNF?
80 * @return true if this VF Module is the base VF Module in its containing Generic VNF;
83 public boolean isBaseVfModule() {