Package dev.aherscu.qa.testing.utils
Class OptionalMatchers
- java.lang.Object
-
- dev.aherscu.qa.testing.utils.OptionalMatchers
-
public class OptionalMatchers extends Object
-
-
Constructor Summary
Constructors Constructor Description OptionalMatchers()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T,S extends T>
org.hamcrest.Matcher<Optional<S>>contains(org.hamcrest.Matcher<T> matcher)
Deprecated.name clashes withMatchers.contains(Matcher)
, usepresent(Matcher)
insteadstatic <T> org.hamcrest.Matcher<Optional<T>>
contains(T content)
Deprecated.name clashes withMatchers.contains(Object...)
, usepresent(Object)
insteadstatic org.hamcrest.Matcher<OptionalDouble>
containsDouble(double content)
Deprecated.Matcher is replaced withpresentDouble(double)
to align with naming ofpresent(Object)
.static org.hamcrest.Matcher<OptionalDouble>
containsDouble(org.hamcrest.Matcher<Double> matcher)
Deprecated.Matcher is replaced withpresentDouble(Matcher)
to align with naming ofpresent(Matcher)
.static org.hamcrest.Matcher<OptionalInt>
containsInt(int content)
Deprecated.Matcher is replaced withpresentInt(int)
to align with naming ofpresent(Object)
.static org.hamcrest.Matcher<OptionalInt>
containsInt(org.hamcrest.Matcher<Integer> matcher)
Deprecated.Matcher is replaced withpresentInt(Matcher)
to align with naming ofpresent(Matcher)
.static org.hamcrest.Matcher<OptionalLong>
containsLong(long content)
Deprecated.Matcher is replaced withpresentLong(long)
to align with naming ofpresent(Object)
.static org.hamcrest.Matcher<OptionalLong>
containsLong(org.hamcrest.Matcher<Long> matcher)
Deprecated.Matcher is replaced withpresentLong(Matcher)
to align with naming ofpresent(Matcher)
.static <T> org.hamcrest.Matcher<Optional<T>>
empty()
Deprecated.name clashes withMatchers.empty()
, usenotPresent()
insteadstatic org.hamcrest.Matcher<OptionalDouble>
emptyDouble()
Deprecated.Matcher is replaced withnotPresentDouble()
to align with naming ofnotPresent()
.static org.hamcrest.Matcher<OptionalInt>
emptyInt()
Deprecated.Matcher is replaced withnotPresentInt()
to align with naming ofnotPresent()
.static org.hamcrest.Matcher<OptionalLong>
emptyLong()
Deprecated.Matcher is replaced withnotPresentLong()
to align with naming ofnotPresent()
.static <T> org.hamcrest.Matcher<Optional<T>>
notPresent()
Matches a not present Optional.static org.hamcrest.Matcher<OptionalDouble>
notPresentDouble()
Matches a not present OptionalDouble.static org.hamcrest.Matcher<OptionalInt>
notPresentInt()
Matches an not present OptionalInt.static org.hamcrest.Matcher<OptionalLong>
notPresentLong()
Matches an OptionalLong with no value.static <T,S extends T>
org.hamcrest.Matcher<Optional<S>>present(org.hamcrest.Matcher<T> matcher)
Matches a present Optional with content matching the given matcherstatic <T> org.hamcrest.Matcher<Optional<T>>
present(T content)
Matches a present Optional with the given contentstatic org.hamcrest.Matcher<OptionalDouble>
presentDouble(double content)
Matches a present OptionalDouble with the given contentstatic org.hamcrest.Matcher<OptionalDouble>
presentDouble(org.hamcrest.Matcher<Double> matcher)
Matches a present OptionalDouble with content matching the given matcherstatic org.hamcrest.Matcher<OptionalInt>
presentInt(int content)
Matches a present OptionalInt with the given contentstatic org.hamcrest.Matcher<OptionalInt>
presentInt(org.hamcrest.Matcher<Integer> matcher)
Matches a present OptionalInt with content matching the given matcherstatic org.hamcrest.Matcher<OptionalLong>
presentLong(long content)
Matches a present OptionalLong with the given contentstatic org.hamcrest.Matcher<OptionalLong>
presentLong(org.hamcrest.Matcher<Long> matcher)
Matches a present OptionalLong with content matching the given matcher
-
-
-
Method Detail
-
notPresent
public static <T> org.hamcrest.Matcher<Optional<T>> notPresent()
Matches a not present Optional.
-
empty
@Deprecated public static <T> org.hamcrest.Matcher<Optional<T>> empty()
Deprecated.name clashes withMatchers.empty()
, usenotPresent()
insteadMatches a not present Optional.
-
present
public static <T> org.hamcrest.Matcher<Optional<T>> present(T content)
Matches a present Optional with the given content- Type Parameters:
T
- The type of the Optional's content- Parameters:
content
- Expected contents of the Optional
-
contains
@Deprecated public static <T> org.hamcrest.Matcher<Optional<T>> contains(T content)
Deprecated.name clashes withMatchers.contains(Object...)
, usepresent(Object)
insteadMatches a present Optional with the given content- Type Parameters:
T
- The type of the Optional's content- Parameters:
content
- Expected contents of the Optional
-
present
public static <T,S extends T> org.hamcrest.Matcher<Optional<S>> present(org.hamcrest.Matcher<T> matcher)
Matches a present Optional with content matching the given matcher- Type Parameters:
T
- The type of the Optional's contentS
- The type matched by the matcher, a subtype of T- Parameters:
matcher
- To match against the Optional's content
-
contains
@Deprecated public static <T,S extends T> org.hamcrest.Matcher<Optional<S>> contains(org.hamcrest.Matcher<T> matcher)
Deprecated.name clashes withMatchers.contains(Matcher)
, usepresent(Matcher)
insteadMatches a present Optional with content matching the given matcher- Type Parameters:
T
- The type of the Optional's contentS
- The type matched by the matcher, a subtype of T- Parameters:
matcher
- To match against the Optional's content
-
notPresentInt
public static org.hamcrest.Matcher<OptionalInt> notPresentInt()
Matches an not present OptionalInt.
-
emptyInt
@Deprecated public static org.hamcrest.Matcher<OptionalInt> emptyInt()
Deprecated.Matcher is replaced withnotPresentInt()
to align with naming ofnotPresent()
.Matches a not present OptionalInt.
-
presentInt
public static org.hamcrest.Matcher<OptionalInt> presentInt(int content)
Matches a present OptionalInt with the given content- Parameters:
content
- Expected contents of the Optional
-
containsInt
@Deprecated public static org.hamcrest.Matcher<OptionalInt> containsInt(int content)
Deprecated.Matcher is replaced withpresentInt(int)
to align with naming ofpresent(Object)
.Matches a present OptionalInt with the given content- Parameters:
content
- Expected contents of the Optional
-
presentInt
public static org.hamcrest.Matcher<OptionalInt> presentInt(org.hamcrest.Matcher<Integer> matcher)
Matches a present OptionalInt with content matching the given matcher- Parameters:
matcher
- To match against the OptionalInt's content
-
containsInt
@Deprecated public static org.hamcrest.Matcher<OptionalInt> containsInt(org.hamcrest.Matcher<Integer> matcher)
Deprecated.Matcher is replaced withpresentInt(Matcher)
to align with naming ofpresent(Matcher)
.Matches a present OptionalInt with content matching the given matcher- Parameters:
matcher
- To match against the OptionalInt's content
-
notPresentLong
public static org.hamcrest.Matcher<OptionalLong> notPresentLong()
Matches an OptionalLong with no value.
-
emptyLong
@Deprecated public static org.hamcrest.Matcher<OptionalLong> emptyLong()
Deprecated.Matcher is replaced withnotPresentLong()
to align with naming ofnotPresent()
.Matches a not present OptionalLong.
-
presentLong
public static org.hamcrest.Matcher<OptionalLong> presentLong(long content)
Matches a present OptionalLong with the given content- Parameters:
content
- Expected contents of the Optional
-
containsLong
@Deprecated public static org.hamcrest.Matcher<OptionalLong> containsLong(long content)
Deprecated.Matcher is replaced withpresentLong(long)
to align with naming ofpresent(Object)
.Matches a present OptionalLong with the given content- Parameters:
content
- Expected contents of the Optional
-
presentLong
public static org.hamcrest.Matcher<OptionalLong> presentLong(org.hamcrest.Matcher<Long> matcher)
Matches a present OptionalLong with content matching the given matcher- Parameters:
matcher
- To match against the OptionalLong's content
-
containsLong
@Deprecated public static org.hamcrest.Matcher<OptionalLong> containsLong(org.hamcrest.Matcher<Long> matcher)
Deprecated.Matcher is replaced withpresentLong(Matcher)
to align with naming ofpresent(Matcher)
.Matches a present OptionalLong with content matching the given matcher- Parameters:
matcher
- To match against the OptionalLong's content
-
notPresentDouble
public static org.hamcrest.Matcher<OptionalDouble> notPresentDouble()
Matches a not present OptionalDouble.
-
emptyDouble
@Deprecated public static org.hamcrest.Matcher<OptionalDouble> emptyDouble()
Deprecated.Matcher is replaced withnotPresentDouble()
to align with naming ofnotPresent()
.Matches a not present OptionalDouble.
-
presentDouble
public static org.hamcrest.Matcher<OptionalDouble> presentDouble(double content)
Matches a present OptionalDouble with the given content- Parameters:
content
- Expected contents of the Optional
-
containsDouble
@Deprecated public static org.hamcrest.Matcher<OptionalDouble> containsDouble(double content)
Deprecated.Matcher is replaced withpresentDouble(double)
to align with naming ofpresent(Object)
.Matches a present OptionalDouble with the given content- Parameters:
content
- Expected contents of the Optional
-
presentDouble
public static org.hamcrest.Matcher<OptionalDouble> presentDouble(org.hamcrest.Matcher<Double> matcher)
Matches a present OptionalDouble with content matching the given matcher- Parameters:
matcher
- To match against the OptionalDouble's content
-
containsDouble
@Deprecated public static org.hamcrest.Matcher<OptionalDouble> containsDouble(org.hamcrest.Matcher<Double> matcher)
Deprecated.Matcher is replaced withpresentDouble(Matcher)
to align with naming ofpresent(Matcher)
.Matches a present OptionalDouble with content matching the given matcher- Parameters:
matcher
- To match against the OptionalDouble's content
-
-