a17931a7994100bb9127d944b7d0ffdd7ed72065
[jFCPlib.git] / src / net / pterodactylus / util / filter / Filter.java
1 /*
2  * jFCPlib - Filter.java -
3  * Copyright © 2009 David Roden
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19 package net.pterodactylus.util.filter;
20
21 /**
22  * Interface for a filter that determines whether a certain action can be
23  * performed on an object based on its properties.
24  *
25  * @param <T>
26  *            The type of the filtered object
27  * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
28  */
29 public interface Filter<T> {
30
31         /**
32          * Runs the given object through this filter and return whether the object
33          * matches this filter or not.
34          *
35          * @param object
36          *            The object to analyse
37          * @return <code>true</code> if the object matched this filter,
38          *         <code>false</code> otherwise
39          */
40         public boolean filterObject(T object);
41
42 }