Move event and metadata handling into abstract base class.
[sonitus.git] / src / main / java / net / pterodactylus / sonitus / data / filter / PredicateFilter.java
index 4edc661..4000a5b 100644 (file)
@@ -26,7 +26,6 @@ import net.pterodactylus.sonitus.data.Filter;
 import net.pterodactylus.sonitus.data.Metadata;
 
 import com.google.common.base.Predicate;
-import com.google.common.eventbus.EventBus;
 
 /**
  * {@link Filter} implementation that uses a {@link Predicate} to determine
@@ -48,15 +47,12 @@ public class PredicateFilter extends DummyFilter {
        /**
         * Creates a new predicate filter.
         *
-        * @param eventBus
-        *              The event bus
         * @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(EventBus eventBus, Predicate<Metadata> metadataPredicate, Filter filter) {
-               super(eventBus, String.format("%s (maybe)", filter.name()));
+       public PredicateFilter(Predicate<Metadata> metadataPredicate, Filter filter) {
+               super(String.format("%s (maybe)", filter.name()));
                this.metadataPredicate = metadataPredicate;
                this.filter = filter;
        }
@@ -106,15 +102,6 @@ public class PredicateFilter extends DummyFilter {
        }
 
        @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);