##### Coverage Report - com.ctrip.apollo.portal.entity.ClusterNavTree

Classes in this File | Line Coverage | Branch Coverage | Complexity
ClusterNavTree |
77% | 7/9
100% | 2/2
| 1.125;1.125
ClusterNavTree$Node |
77% | 7/9
N/A | N/A
| 1.125;1.125

1 |  |
     package com.ctrip.apollo.portal.entity;
2 |  |
3 |  |
     import com.ctrip.apollo.core.enums.Env;
4 |  |
     import com.ctrip.apollo.core.dto.ClusterDTO;
5 |  |
6 |  |
     import java.util.LinkedList;
7 |  |
     import java.util.List;
8 |  |
9 | 1 |
     public class ClusterNavTree {
10 |  |
11 |  |
       private List<Node> nodes;
12 |  |
13 |  |
       public void addNode(Node node){
14 | 2 |
         if (nodes == null){
15 | 1 |
           nodes = new LinkedList<>();
16 |  |
         }
17 |  |
18 | 2 |
         nodes.add(node);
19 | 2 |
       }
20 |  |
21 | 1 |
         public static class Node{
22 |  |
           private Env env;
23 |  |
           private List<ClusterDTO> clusters;
24 |  |
25 | 2 |
           public Node(Env env){
26 | 2 |
             this.env = env;
27 | 2 |
           }
28 |  |
29 |  |
           public Env getEnv() {
30 | 1 |
             return env;
31 |  |
           }
32 |  |
33 |  |
           public void setEnv(Env env) {
34 | 0 |
             this.env = env;
35 | 0 |
           }
36 |  |
37 |  |
           public List<ClusterDTO> getClusters() {
38 | 2 |
             return clusters;
39 |  |
           }
40 |  |
41 |  |
           public void setClusters(List<ClusterDTO> clusters) {
42 | 2 |
             this.clusters = clusters;
43 | 2 |
           }
44 |  |
         }
45 |  |
46 |  |
47 |  |
       public List<Node> getNodes() {
48 | 2 |
         return nodes;
49 |  |
       }
50 |  |
51 |  |
       public void setNodes(List<Node> nodes) {
52 | 0 |
         this.nodes = nodes;
53 | 0 |
       }
54 |  |
     }