Coverage Report - org.jtheque.primary.services.able.ICountriesService
 
Classes in this File Line Coverage Branch Coverage Complexity
ICountriesService
N/A
N/A
1
 
 1  
 package org.jtheque.primary.services.able;
 2  
 
 3  
 import org.jtheque.core.managers.persistence.able.DataContainer;
 4  
 import org.jtheque.primary.od.able.Country;
 5  
 
 6  
 import java.util.Collection;
 7  
 
 8  
 /*
 9  
  * This file is part of JTheque.
 10  
  *
 11  
  * JTheque is free software: you can redistribute it and/or modify
 12  
  * it under the terms of the GNU General Public License as published by
 13  
  * the Free Software Foundation, either version 3 of the License.
 14  
  *
 15  
  * JTheque is distributed in the hope that it will be useful,
 16  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 18  
  * GNU General Public License for more details.
 19  
  *
 20  
  * You should have received a copy of the GNU General Public License
 21  
  * along with JTheque.  If not, see <http://www.gnu.org/licenses/>.
 22  
  */
 23  
 
 24  
 /**
 25  
  * A countries service specification.
 26  
  *
 27  
  * @author Baptiste Wicht
 28  
  */
 29  
 public interface ICountriesService extends DataContainer<Country> {
 30  
     String DATA_TYPE = "Countries";
 31  
 
 32  
     /**
 33  
      * Return the default country.
 34  
      *
 35  
      * @return The default country.
 36  
      */
 37  
     Country getDefaultCountry();
 38  
 
 39  
     /**
 40  
      * Save the country.
 41  
      *
 42  
      * @param country The country to save.
 43  
      */
 44  
     void save(Country country);
 45  
 
 46  
     /**
 47  
      * Create the country.
 48  
      *
 49  
      * @param country The country to create.
 50  
      */
 51  
     void create(Country country);
 52  
 
 53  
     /**
 54  
      * Delete the country.
 55  
      *
 56  
      * @param country The country to delete.
 57  
      * @return true if the country has been deleted else false.
 58  
      */
 59  
     boolean delete(Country country);
 60  
 
 61  
     /**
 62  
      * Return all the countries.
 63  
      *
 64  
      * @return A List containing all the countries.
 65  
      */
 66  
     Collection<Country> getCountries();
 67  
 
 68  
     /**
 69  
      * Return the country with the name.
 70  
      *
 71  
      * @param name The name of the searched country.
 72  
      * @return The country else null if the country doesn't exist.
 73  
      */
 74  
     Country getCountry(String name);
 75  
 
 76  
     /**
 77  
      * Create all the countries.
 78  
      *
 79  
      * @param countries The countries to create.
 80  
      */
 81  
     void createAll(Iterable<Country> countries);
 82  
 
 83  
     /**
 84  
      * Indicate if a country exist or not.
 85  
      *
 86  
      * @param country The country to test.
 87  
      * @return <code>true</code> if the country exist else <code>false</code>.
 88  
      */
 89  
     boolean exist(Country country);
 90  
 
 91  
     /**
 92  
      * Return an empty country.
 93  
      *
 94  
      * @return The empty country.
 95  
      */
 96  
     Country getEmptyCountry();
 97  
 
 98  
     /**
 99  
      * Indicate if a country with the specified exists.
 100  
      *
 101  
      * @param name The name of the country.
 102  
      * @return <code>true</code> if the country exists else <code>false</code>.
 103  
      */
 104  
     boolean exist(String name);
 105  
 }