public class OptionalMatchers extends Object
| Constructor and Description |
|---|
OptionalMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static <T,S extends T> |
contains(org.hamcrest.Matcher<T> matcher)
Matches a non empty Optional with content matching the given matcher
|
static <T> org.hamcrest.Matcher<Optional<T>> |
contains(T content)
Matches a non empty Optional with the given content
|
static org.hamcrest.Matcher<OptionalDouble> |
containsDouble(double content)
Matches a non empty OptionalDouble with the given content
|
static org.hamcrest.Matcher<OptionalDouble> |
containsDouble(org.hamcrest.Matcher<Double> matcher)
Matches a non empty OptionalDouble with content matching the given matcher
|
static org.hamcrest.Matcher<OptionalInt> |
containsInt(int content)
Matches a non empty OptionalInt with the given content
|
static org.hamcrest.Matcher<OptionalInt> |
containsInt(org.hamcrest.Matcher<Integer> matcher)
Matches a non empty OptionalInt with content matching the given matcher
|
static org.hamcrest.Matcher<OptionalLong> |
containsLong(long content)
Matches a non empty OptionalLong with the given content
|
static org.hamcrest.Matcher<OptionalLong> |
containsLong(org.hamcrest.Matcher<Long> matcher)
Matches a non empty OptionalLong with content matching the given matcher
|
static <T> org.hamcrest.Matcher<Optional<T>> |
empty()
Matches an empty Optional.
|
static org.hamcrest.Matcher<OptionalDouble> |
emptyDouble()
Matches an empty OptionalDouble.
|
static org.hamcrest.Matcher<OptionalInt> |
emptyInt()
Matches an empty OptionalInt.
|
static org.hamcrest.Matcher<OptionalLong> |
emptyLong()
Matches an empty OptionalLong.
|
public static <T> org.hamcrest.Matcher<Optional<T>> empty()
public static <T> org.hamcrest.Matcher<Optional<T>> contains(T content)
T - The type of the Optional's contentcontent - Expected contents of the Optionalpublic static <T,S extends T> org.hamcrest.Matcher<Optional<S>> contains(org.hamcrest.Matcher<T> matcher)
T - The type of the Optional's contentS - The type matched by the matcher, a subtype of Tmatcher - To match against the Optional's contentpublic static org.hamcrest.Matcher<OptionalInt> emptyInt()
public static org.hamcrest.Matcher<OptionalInt> containsInt(int content)
content - Expected contents of the Optionalpublic static org.hamcrest.Matcher<OptionalInt> containsInt(org.hamcrest.Matcher<Integer> matcher)
matcher - To match against the OptionalInt's contentpublic static org.hamcrest.Matcher<OptionalLong> emptyLong()
public static org.hamcrest.Matcher<OptionalLong> containsLong(long content)
content - Expected contents of the Optionalpublic static org.hamcrest.Matcher<OptionalLong> containsLong(org.hamcrest.Matcher<Long> matcher)
matcher - To match against the OptionalLong's contentpublic static org.hamcrest.Matcher<OptionalDouble> emptyDouble()
public static org.hamcrest.Matcher<OptionalDouble> containsDouble(double content)
content - Expected contents of the Optionalpublic static org.hamcrest.Matcher<OptionalDouble> containsDouble(org.hamcrest.Matcher<Double> matcher)
matcher - To match against the OptionalDouble's contentCopyright © 2018. All rights reserved.