View Javadoc

1   //
2   //Author       : t.wood
3   //Copyright    : (c) Resilient Networks plc 2012 - All Rights Reserved
4   //
5   package com.lexicalscope.jewel.cli.validation;
6   
7   import java.util.List;
8   import java.util.Map.Entry;
9   
10  import org.hamcrest.Description;
11  import org.hamcrest.Matcher;
12  import org.hamcrest.TypeSafeMatcher;
13  
14  public class RawOptionMatchers
15  {
16     public static Matcher<Entry<RawOption, List<String>>> isLastOption()
17     {
18        return new TypeSafeMatcher<Entry<RawOption, List<String>>>()
19        {
20           @Override
21           public void describeTo(final Description description)
22           {
23              description.appendText("the last option");
24           }
25  
26           @Override
27           protected boolean matchesSafely(final Entry<RawOption, List<String>> item)
28           {
29              return item.getKey().isLast();
30           }
31        };
32     }
33  }