##### Coverage Report - org.jbehave.core.model.StepPattern

Classes in this File | Line Coverage | Branch Coverage | Complexity
StepPattern |
100% | 9/9
N/A | N/A
| 1.0;1

1 |  |
     package org.jbehave.core.model;
2 |  |
3 |  |
     import org.apache.commons.lang.builder.ToStringBuilder;
4 |  |
     import org.apache.commons.lang.builder.ToStringStyle;
5 |  |
     import org.jbehave.core.parsers.RegexStepMatcher;
6 |  |
     import org.jbehave.core.parsers.StepMatcher;
7 |  |
     import org.jbehave.core.steps.StepType;
8 |  |
9 |  |
     /**
10 |  |
      * <p>
11 |  |
      * Represents a step pattern, as provided in the method annotations.
12 |  |
      * This pattern will in turn be resolved by the chosen {@link StepMatcher},
13 |  |
      * e.g. a regex pattern if using the {@link RegexStepMatcher}
14 |  |
      * </p>
15 |  |
      */
16 |  |
     public class StepPattern {
17 |  |
18 |  |
         private StepType stepType;
19 |  |
         private final String annotated;
20 |  |
         private final String resolved;
21 |  |
22 | 130 |
         public StepPattern(StepType stepType, String annotated, String resolved) {
23 | 130 |
             this.stepType = stepType;
24 | 130 |
             this.annotated = annotated;
25 | 130 |
             this.resolved = resolved;
26 | 130 |
         }
27 |  |
28 |  |
         /**
29 |  |
          * Returns the step pattern as provided in the method annotation
30 |  |
          * @return The String representing the annotated pattern
31 |  |
          */
32 |  |
         public String annotated(){
33 | 8 |
             return annotated;
34 |  |
             }
35 |  |
36 |  |
             /**
37 |  |
              * Return the step pattern as resolved by the step matcher
38 |  |
              * @return The String representing the resolved pattern
39 |  |
              */
40 |  |
             public String resolved(){
41 | 4 |
                 return resolved;
42 |  |
             }
43 |  |
44 |  |
         /**
45 |  |
          * Return the step type
46 |  |
          * @return The enum for the StepType
47 |  |
          */
48 |  |
         public StepType type() {
49 | 8 |
             return stepType;
50 |  |
         }
51 |  |
52 |  |
         @Override
53 |  |
             public String toString() {
54 | 55 |
                 return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
55 |  |
             }
56 |  |
57 |  |
     }