1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
package com.lexicalscope.jewel.cli.specification; |
6 | |
|
7 | |
import org.hamcrest.Description; |
8 | |
import org.hamcrest.Matcher; |
9 | |
import org.hamcrest.TypeSafeMatcher; |
10 | |
|
11 | 0 | public class OptionSpecificationMatchers |
12 | |
{ |
13 | |
public static Matcher<ParsedOptionSpecification> mandatory() |
14 | |
{ |
15 | 226 | return new TypeSafeMatcher<ParsedOptionSpecification>(ParsedOptionSpecification.class) |
16 | 338 | { |
17 | |
@Override |
18 | |
public void describeTo(final Description description) |
19 | |
{ |
20 | 0 | description.appendText("mandatory option"); |
21 | 0 | } |
22 | |
|
23 | |
@Override |
24 | |
protected boolean matchesSafely(final ParsedOptionSpecification item) |
25 | |
{ |
26 | 112 | return !item.isOptional(); |
27 | |
} |
28 | |
}; |
29 | |
} |
30 | |
} |