##### Coverage Report - com.ctrip.apollo.portal.entity.form.NamespaceSyncModel

Classes in this File | Line Coverage | Branch Coverage | Complexity
NamespaceSyncModel |
0% | 0/14
0% | 0/8
| 2.2;2.2

1 |  |
     package com.ctrip.apollo.portal.entity.form;
2 |  |
3 |  |
     import com.ctrip.apollo.core.dto.ItemDTO;
4 |  |
     import com.ctrip.apollo.portal.entity.NamespaceIdentifer;
5 |  |
6 |  |
     import org.springframework.util.CollectionUtils;
7 |  |
8 |  |
     import java.util.List;
9 |  |
10 | 0 |
     public class NamespaceSyncModel implements Verifiable {
11 |  |
12 |  |
       private List<NamespaceIdentifer> syncToNamespaces;
13 |  |
       private List<ItemDTO> syncItems;
14 |  |
15 |  |
       @Override
16 |  |
       public boolean isInvalid() {
17 | 0 |
         if (CollectionUtils.isEmpty(syncToNamespaces) || CollectionUtils.isEmpty(syncItems)){
18 | 0 |
           return true;
19 |  |
         }
20 | 0 |
         for (NamespaceIdentifer namespaceIdentifer: syncToNamespaces){
21 | 0 |
           if (namespaceIdentifer.isInvalid()){
22 | 0 |
             return true;
23 |  |
           }
24 | 0 |
         }
25 | 0 |
         return false;
26 |  |
       }
27 |  |
28 |  |
       public List<NamespaceIdentifer> getSyncToNamespaces() {
29 | 0 |
         return syncToNamespaces;
30 |  |
       }
31 |  |
32 |  |
       public void setSyncToNamespaces(List<NamespaceIdentifer> syncToNamespaces) {
33 | 0 |
         this.syncToNamespaces = syncToNamespaces;
34 | 0 |
       }
35 |  |
36 |  |
       public List<ItemDTO> getSyncItems() {
37 | 0 |
         return syncItems;
38 |  |
       }
39 |  |
40 |  |
       public void setSyncItems(List<ItemDTO> syncItems) {
41 | 0 |
         this.syncItems = syncItems;
42 | 0 |
       }
43 |  |
     }