jocarreira / hamcrest

Automatically exported from code.google.com/p/hamcrest
0 stars 0 forks source link

Return more specific type from collection matcher factories #57

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The matcher factory methods in all of the classes in the
org.hamcrest.collection package are all defined to return a Matcher<xxx>
when it seems like they could be returning a TypeSafeMatcher<xxx>. This can
be especially useful when combining them into matcher collections. Is there
some reason for this I'm missing?

Original issue reported on code.google.com by mhack...@kanayo.com on 23 Dec 2008 at 3:39

GoogleCodeExporter commented 8 years ago
Matcher is the interface that clients call.  TypeSafeMatcher is an abstract base
class for the convenience of implementors.  Code that uses matchers should not 
know
nor care about the existence of the TypeSafeMatcher class.

Original comment by nat.pr...@gmail.com on 23 Dec 2008 at 7:26

GoogleCodeExporter commented 8 years ago
Ah, of course. I understand now. That makes sense. Thanks.

Original comment by mhack...@kanayo.com on 23 Dec 2008 at 4:35