2 * ============LICENSE_START=======================================================
\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
11 * http://www.apache.org/licenses/LICENSE-2.0
\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
21 package org.openecomp.mso.bpmn.common.scripts;
\r
23 import org.apache.commons.lang3.*
\r
25 public class VfModule implements Serializable {
\r
28 * Class representing a VF Module Node. Fields of this class include indicators
\r
29 * as to whether the VF Module is the only VF Module in its containing Generic VNF
\r
30 * and whether the VF Module is the base VF Module in its containing Generic VNF.
\r
34 private Boolean onlyVfModule
\r
35 private Boolean baseVfModule
\r
40 * @param node Node representing the VF Module xml.
\r
41 * @param onlyVfModule Is this VF Module the only VF Module in its containing Generic VNF?
\r
43 public VfModule(Node node, boolean onlyVfModule) {
\r
45 this.onlyVfModule = onlyVfModule
\r
46 this.baseVfModule = getElementText('is-base-vf-module').equals('true')
\r
50 * Get the Node representing the VF Module xml.
\r
52 * @return the Node representing the VF Module xml.
\r
54 public Node getNode() {
\r
58 public String getElementText(String childNodeName) {
\r
59 def Node childNode = (new MsoUtils()).getChildNode(node, childNodeName)
\r
60 if (childNode == null) {
\r
63 return childNode.text()
\r
68 * Is this VF Module the only VF Module in its containing Generic VNF?
\r
70 * @return true if this VF Module is the only VF Module in its containing Generic VNF;
\r
73 public boolean isOnlyVfModule() {
\r
78 * Is this VF Module the base VF Module in its containing Generic VNF?
\r
80 * @return true if this VF Module is the base VF Module in its containing Generic VNF;
\r
83 public boolean isBaseVfModule() {
\r