* @param metadataPredicate
* The predicate to evaluate every time the metadata changes
* @param filter
- * The filter to use if the predicate matches the metadata
*/
public PredicateFilter(Predicate<Metadata> metadataPredicate, Filter filter) {
+ super(String.format("%s (maybe)", filter.name()));
this.metadataPredicate = metadataPredicate;
this.filter = filter;
}
}
@Override
- public Metadata metadata() {
- if (metadataMatches.get()) {
- return filter.metadata();
- } else {
- return super.metadata();
- }
- }
-
- @Override
public byte[] get(int bufferSize) throws IOException {
if (metadataMatches.get()) {
return filter.get(bufferSize);