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

Classes in this File | Line Coverage | Branch Coverage | Complexity
StoryMap |
100% | 11/11
100% | 2/2
| 1.2;1.2

1 |  |
     package org.jbehave.core.model;
2 |  |
3 |  |
     import java.util.ArrayList;
4 |  |
     import java.util.List;
5 |  |
     import java.util.Set;
6 |  |
7 |  |
     import org.apache.commons.lang.builder.ToStringBuilder;
8 |  |
     import org.apache.commons.lang.builder.ToStringStyle;
9 |  |
10 |  |
     /**
11 |  |
      *  Groups a set of {@link Story}s by meta filter.
12 |  |
      */
13 |  |
     public class StoryMap {
14 |  |
15 |  |
         private final String metaFilter;
16 |  |
         private final Set<Story> stories;
17 |  |
18 | 3 |
         public StoryMap(String metaFilter, Set<Story> stories) {
19 | 3 |
             this.metaFilter = metaFilter;
20 | 3 |
             this.stories = stories;
21 | 3 |
         }
22 |  |
23 |  |
         public String getMetaFilter(){
24 | 4 |
             return metaFilter;
25 |  |
         }
26 |  |
27 |  |
         public List<Story> getStories(){
28 | 9 |
             return new ArrayList<Story>(stories);
29 |  |
         }
30 |  |
31 |  |
         public List<String> getStoryPaths() {
32 | 2 |
             List<String> paths = new ArrayList<String>();
33 | 2 |
             for (Story story : stories) {
34 | 3 |
                 paths.add(story.getPath());
35 |  |
             }
36 | 2 |
             return paths;
37 |  |
         }
38 |  |
39 |  |
         @Override
40 |  |
         public String toString() {
41 | 1 |
             return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append(metaFilter).append(getStoryPaths()).toString();
42 |  |
         }
43 |  |
44 |  |
     }