public static < T > Filter < T > or ( final Filter < T > f1 , final Filter < T > f2 ) { return new Filter < T > ( ) { @ Override public boolean matches ( Path . ID id , Content . Type < T > ct ) { return f1 . matches ( id , ct ) || f2 . matches ( id , ct ) ; } @ Override public boolean matchesSubpath ( Path . ID id ) { return f1 . matchesSubpath ( id ) || f2 . matchesSubpath ( id ) ; } @ Override public String toString ( ) { return f1 . toString ( ) + "|" + f2 . toString ( ) ; } } ; }
Combine two filters together produce one filter whose items must be matched by at least one of the original filters .