Skip to content

Commit

Permalink
adds an handy constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
monperrus committed Apr 18, 2016
1 parent 5c33091 commit 7659714
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ public AbstractFilter(Class<? super T> type) {
this.type = (Class<T>) type;
}

/**
* Creates a filter with the no typing constraint.
*/
@SuppressWarnings("unchecked")
public AbstractFilter() {
this.type = (Class<T>) CtElement.class;
}

@Override
public boolean matches(T element) {
return type.isAssignableFrom(element.getClass());
Expand Down

0 comments on commit 7659714

Please sign in to comment.