Just wraps the assertions in the java.io.File class with hamcrest
matchers.
May be useful to somebody..
Cheers
James
Nat Pryce
unread,
Nov 28, 2007, 5:10:35 PM11/28/07
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to hamcre...@googlegroups.com
Sweet. That gave me two ideas.
Firstly, an implementation of FileFilter that delegates to a matcher.
Secondly, a compiler that takes any class and translates all isXXX boolean property accessors to matchers and all getXXX property accessors to "has" matchers.
--Nat
JamesRichardson
unread,
Nov 28, 2007, 6:46:39 PM11/28/07
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Hamcrest Java Users
The first one shouldn't take long!
import org.hamcrest.Matcher;
import java.io.File;
import java.io.FileFilter;
public class FileFilterMatcher implements FileFilter {
private final Matcher<File> matcher;
public FileFilterMatcher(Matcher<File> matcher) {
this.matcher = matcher;
}
public boolean accept(File file) {
return matcher.matches(file);