Coverage Report - org.jbehave.core.model.StepPattern
 
Classes in this File Line Coverage Branch Coverage Complexity
StepPattern
100%
9/9
N/A
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  105
     public StepPattern(StepType stepType, String annotated, String resolved) {
 23  105
         this.stepType = stepType;
 24  105
         this.annotated = annotated;
 25  105
         this.resolved = resolved;
 26  105
     }
 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  10
             return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
 55  
         }
 56  
         
 57  
 }