2 * Rhynodge - AbstractWatcher.java - Copyright © 2013 David Roden
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package net.pterodactylus.rhynodge.watchers;
20 import java.util.ArrayList;
21 import java.util.List;
23 import net.pterodactylus.rhynodge.Filter;
24 import net.pterodactylus.rhynodge.Query;
25 import net.pterodactylus.rhynodge.Trigger;
26 import net.pterodactylus.rhynodge.Watcher;
29 * Abstract base implementation of a {@link Watcher}.
31 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
33 public class DefaultWatcher implements Watcher {
35 /** The query of the watcher. */
36 private final Query query;
38 /** The filters of the watcher. */
39 private final List<Filter> filters = new ArrayList<Filter>();
41 /** The trigger of the watcher. */
42 private final Trigger trigger;
45 * Creates a new default watcher.
48 * The query of the watcher
50 * The filters of the watcher
52 * The trigger of the watcher
54 protected DefaultWatcher(Query query, List<Filter> filters, Trigger trigger) {
56 this.filters.addAll(filters);
57 this.trigger = trigger;
68 public Query query() {
76 public List<Filter> filters() {
84 public Trigger trigger() {