View Javadoc

1   /**
2    * 
3    */
4   package sirius.utils.retriever.types.usage;
5   
6   import com.cedarsoftware.util.io.JsonObject;
7   
8   /**
9    * @author Myk Kolisnyk
10   *
11   */
12  public class CucumberStep {
13      /**
14       * .
15       */
16      private String name;
17      /**
18       * .
19       */
20      private CucumberAggregatedDuration aggregatedDurations;
21      /**
22       * .
23       */
24      private CucumberStepDuration[] durations;
25      /**
26       * @return the name
27       */
28      public String getName() {
29          return name;
30      }
31      /**
32       * @param name the name to set
33       */
34      public void setName(String name) {
35          this.name = name;
36      }
37      /**
38       * @return the aggregatedDurations
39       */
40      public CucumberAggregatedDuration getAggregatedDurations() {
41          return aggregatedDurations;
42      }
43      /**
44       * @param aggregatedDurations the aggregatedDurations to set
45       */
46      public void setAggregatedDurations(
47              CucumberAggregatedDuration aggregatedDurations) {
48          this.aggregatedDurations = aggregatedDurations;
49      }
50      /**
51       * @return the durations
52       */
53      public CucumberStepDuration[] getDurations() {
54          return durations;
55      }
56      /**
57       * @param durations the durations to set
58       */
59      public void setDurations(CucumberStepDuration[] durations) {
60          this.durations = durations;
61      }
62      /**
63       * @param name
64       * @param aggregatedDurations
65       * @param durations
66       */
67      public CucumberStep(String name,
68              CucumberAggregatedDuration aggregatedDurations,
69              CucumberStepDuration[] durations) {
70          super();
71          this.name = name;
72          this.aggregatedDurations = aggregatedDurations;
73          this.durations = durations;
74      }
75      /**
76       * @param jsonObject
77       */
78      public CucumberStep(JsonObject<String, Object> json) {
79          this.name = (String)json.get("name");
80          this.aggregatedDurations = new CucumberAggregatedDuration((JsonObject<String, Object>)json.get("aggregatedDurations"));
81          Object[] objs = (Object[])((JsonObject<String, Object>)json.get("durations")).get("@items");
82          this.durations = new CucumberStepDuration[objs.length];
83          
84          for(int i=0;i<objs.length;i++){
85              this.durations[i] = new CucumberStepDuration((JsonObject<String, Object>)objs[i]);
86          }
87      }    
88  }