You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can be useful to specify some general restriction for all (or remaining) components of a record, instead of enumerating all the components with the same matcher.
Example case:
specify a matcher for a single value, but it is also imperative that the remaining components have not been set, i.e. they should be nullValue().
Typing
A general matcher must necessarily be typed as either fixed Matcher<Object> or the most specific type that works with all components. Say, if if you have record (Integer i, Long l) {}, a matcher for all components could be Matcher<Number>, where Number is inferred as the common type which is applicable for both Integer and Long. Ideally, this should also be inferred should the components use primitive types int and long.
The text was updated successfully, but these errors were encountered:
Can be useful to specify some general restriction for all (or remaining) components of a record, instead of enumerating all the components with the same matcher.
Example case:
Typing
A general matcher must necessarily be typed as either fixed
Matcher<Object>
or the most specific type that works with all components. Say, if if you haverecord (Integer i, Long l) {}
, a matcher for all components could beMatcher<Number>
, whereNumber
is inferred as the common type which is applicable for bothInteger
andLong
. Ideally, this should also be inferred should the components use primitive typesint
andlong
.The text was updated successfully, but these errors were encountered: