e8e22a4225b31dd5d1577cafe293523758b65ddb
[vid.git] / vid-webpack-master / src / app / drawingBoard / service-planning / typeNodeInformation.model.ts
1 import {ITreeNode} from "angular-tree-component/dist/defs/api";
2 import * as _ from 'lodash';
3
4 export class TypeNodeInformation {
5   hierarchyName: string;
6   existingMappingCounterName: string;
7
8   constructor(node: ITreeNode) {
9     if (!_.isNil(node)) {
10       switch (node.data.type) {
11         case 'VF' : {
12           this.hierarchyName = 'vnfs';
13           this.existingMappingCounterName = 'existingVNFCounterMap';
14           break;
15         }
16         case 'VnfGroup' : {
17           this.hierarchyName = 'vnfGroups';
18           this.existingMappingCounterName = 'existingVnfGroupCounterMap';
19           break;
20         }
21         case 'VL' : {
22           this.hierarchyName = 'networks';
23           this.existingMappingCounterName = 'existingNetworksCounterMap';
24           break;
25         }
26         case 'Network': {
27           this.hierarchyName = 'networks';
28           this.existingMappingCounterName = 'existingNetworksCounterMap';
29           break;
30         }
31         default : {
32           console.error("Node type is not recognize");
33         }
34       }
35     }
36   }
37 }
38
39