maaartinus
maaartinus

Reputation: 46472

What is a not-to-be-implemented interface good for?

I really wonder what can be such an interface used for. The purpose of the method called

_dont_implement_Matcher___instead_extend_BaseMatcher_

is crystal clear, but what's the purpose of the interface?

If I didn't want people to implement an interface, I simply wouldn't provide any - an abstract class does the job. Unless there's some hidden reason I can't see. Can anybody?

Upvotes: 2

Views: 93

Answers (1)

Eamonn McEvoy
Eamonn McEvoy

Reputation: 8986

Look to me like Matcher is an old interface that has been replaced by BaseMatcher but has not been removed to maintain compatibility with older versions.

edit:

The revision history seems to back this up: http://code.google.com/p/hamcrest/source/diff?spec=svn46&r=46&format=side&path=/trunk/hamcrest-java/src/api/org/hamcrest/Matcher.java

Upvotes: 5

Related Questions