1 package org.springframework.samples.countries; 2 3 import java.util.List; 4 import java.util.Locale; 5 6 /** 7 * @author Jean-Pierre Pawlak 8 * @author Juergen Hoeller 9 */ 10 public interface CountryService { 11 12 /** 13 * Provides the list of all ICountries in the given Locale. 14 * @param locale The Locale for which the records are intended 15 * @return The list of all countries in the given Locale 16 */ 17 List getAllCountries(Locale locale); 18 19 /** 20 * Provides a list of ICountries in the given Locale with name and code 21 * starting with the corresponding parameters. A null or empty String 22 * in the parameter is interpreted as no filtering on that parameter. 23 * @param name beginning of the name of the requested records 24 * @param code beginning of the code of the requested records 25 * @param locale the Locale for which the records are intended 26 * @return the list of Country objects matching with parameters in the given Locale 27 */ 28 List getFilteredCountries(String name, String code, Locale locale); 29 30 /** 31 * Get a Country object following the parameters. 32 * @param code the code of the requested country 33 * @param locale the locale to use for searching the country 34 * @return the Country object corresponding on the parameters 35 */ 36 Country getCountry(String code, Locale locale); 37 38 } 39