Clover icon

sunshower-core

  1. Project Clover database Fri Apr 6 2018 03:27:42 UTC
  2. Package io.sunshower.service.model.task

File ExecutionPlan.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart0.png
60% of files have more coverage

Code metrics

2
18
9
1
71
56
10
0.56
2
9
1.11

Classes

Class Line # Actions
ExecutionPlan 12 18 10
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package io.sunshower.service.model.task;
2   
3    import io.sunshower.common.Identifier;
4    import io.sunshower.common.rs.IdentifierConverter;
5    import java.util.ArrayList;
6    import java.util.List;
7    import javax.xml.bind.annotation.*;
8    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
9   
10    /** Created by haswell on 2/8/17. */
11    @XmlRootElement(name = "tree")
 
12    public class ExecutionPlan {
13   
14    @XmlAttribute(name = "id")
15    @XmlJavaTypeAdapter(IdentifierConverter.class)
16    private Identifier id;
17   
18    @XmlElement(name = "level")
19    @XmlElementWrapper(name = "levels")
20    private List<ExecutionLevel> levels = new ArrayList<>();
21   
22    @XmlTransient private transient Object payload;
23   
 
24  0 toggle public ExecutionPlan() {}
25   
 
26  0 toggle public ExecutionPlan(Identifier id, Object payload) {
27  0 this.id = id;
28  0 this.payload = payload;
29    }
30   
 
31  0 toggle public Object getPayload() {
32  0 return payload;
33    }
34   
 
35  0 toggle public void setPayload(Object payload) {
36  0 this.payload = payload;
37    }
38   
 
39  0 toggle public void addLevel(ExecutionLevel level) {
40  0 levels.add(level);
41    }
42   
 
43  0 toggle public List<ExecutionLevel> getLevels() {
44  0 return levels;
45    }
46   
 
47  0 toggle public void setLevels(List<ExecutionLevel> levels) {
48  0 this.levels = levels;
49    }
50   
 
51  0 toggle @Override
52    public String toString() {
53  0 StringBuilder b = new StringBuilder();
54  0 for (ExecutionLevel i : levels) {
55  0 indent(i.getLevel(), b);
56  0 b.append("Level { order = " + i.getLevel() + " \n");
57  0 for (ExecutionTask t : i.getTasks()) {
58  0 indent(i.getLevel() + 1, b);
59  0 b.append(t);
60  0 b.append("\n");
61    }
62    }
63  0 return b.toString();
64    }
65   
 
66  0 toggle private void indent(int level, StringBuilder b) {
67  0 for (int i = 0; i < level; i++) {
68  0 b.append(" ");
69    }
70    }
71    }