aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/typeNodeInformation.model.ts
blob: e8e22a4225b31dd5d1577cafe293523758b65ddb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import {ITreeNode} from "angular-tree-component/dist/defs/api";
import * as _ from 'lodash';

export class TypeNodeInformation {
  hierarchyName: string;
  existingMappingCounterName: string;

  constructor(node: ITreeNode) {
    if (!_.isNil(node)) {
      switch (node.data.type) {
        case 'VF' : {
          this.hierarchyName = 'vnfs';
          this.existingMappingCounterName = 'existingVNFCounterMap';
          break;
        }
        case 'VnfGroup' : {
          this.hierarchyName = 'vnfGroups';
          this.existingMappingCounterName = 'existingVnfGroupCounterMap';
          break;
        }
        case 'VL' : {
          this.hierarchyName = 'networks';
          this.existingMappingCounterName = 'existingNetworksCounterMap';
          break;
        }
        case 'Network': {
          this.hierarchyName = 'networks';
          this.existingMappingCounterName = 'existingNetworksCounterMap';
          break;
        }
        default : {
          console.error("Node type is not recognize");
        }
      }
    }
  }
}