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 CucumberStepSource {
13      /**
14       * .
15       */
16      private String source;
17      /**
18       * .
19       */
20      private CucumberStep[] steps;
21      /**
22       * @return the source
23       */
24      public String getSource() {
25          return source;
26      }
27      /**
28       * @param source the source to set
29       */
30      public void setSource(String source) {
31          this.source = source;
32      }
33      /**
34       * @return the steps
35       */
36      public CucumberStep[] getSteps() {
37          return steps;
38      }
39      /**
40       * @param steps the steps to set
41       */
42      public void setSteps(CucumberStep[] steps) {
43          this.steps = steps;
44      }
45      /**
46       * @param source
47       * @param steps
48       */
49      public CucumberStepSource(String source, CucumberStep[] steps) {
50          super();
51          this.source = source;
52          this.steps = steps;
53      }
54      
55      public CucumberStepSource(JsonObject<String,Object> json){
56          this.source = (String)json.get("source");
57          Object[] objs = (Object[])((JsonObject<String,Object>)json.get("steps")).get("@items");
58          this.steps = new CucumberStep[objs.length];
59          for(int i=0;i<objs.length;i++){
60              this.steps[i] = new CucumberStep((JsonObject<String,Object>)objs[i]);
61          }
62      }
63  }