Coverage Report - org.jtheque.films.services.impl.utils.search.filters.CountryFilter
 
Classes in this File Line Coverage Branch Coverage Complexity
CountryFilter
0 %
0/5
N/A
1
 
 1  
 package org.jtheque.films.services.impl.utils.search.filters;
 2  
 
 3  
 /*
 4  
  * This file is part of JTheque.
 5  
  *            
 6  
  * JTheque is free software: you can redistribute it and/or modify
 7  
  * it under the terms of the GNU General Public License as published by
 8  
  * the Free Software Foundation, either version 3 of the License. 
 9  
  *
 10  
  * JTheque 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 JTheque.  If not, see <http://www.gnu.org/licenses/>.
 17  
  */
 18  
 
 19  
 import org.jtheque.primary.od.able.Country;
 20  
 import org.jtheque.primary.od.able.Person;
 21  
 import org.jtheque.utils.collections.Filter;
 22  
 
 23  
 /**
 24  
  * A filter for countries.
 25  
  *
 26  
  * @author Baptiste Wicht
 27  
  * @param <T> The type of object to filters.
 28  
  */
 29  0
 public final class CountryFilter<T extends Person> implements Filter<T> {
 30  
     private final Country country;
 31  
 
 32  
     /**
 33  
      * Construct a new <code>CountryFilter</code>.
 34  
      *
 35  
      * @param country The country to filter for.
 36  
      */
 37  
     public CountryFilter(Country country) {
 38  0
         super();
 39  
 
 40  0
         this.country = country;
 41  0
     }
 42  
 
 43  
     @Override
 44  
     public boolean accept(T person) {
 45  0
         return person.getTheCountry().equals(country);
 46  
     }
 47  
 }