| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| CountryService |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2008 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.opensource.org/licenses/ecl2.php | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | package org.kuali.rice.kns.service; | |
| 17 | ||
| 18 | import java.util.List; | |
| 19 | ||
| 20 | import org.kuali.rice.kns.bo.Country; | |
| 21 | ||
| 22 | public interface CountryService { | |
| 23 | ||
| 24 | /** | |
| 25 | * get a country object based on the given country code. | |
| 26 | * | |
| 27 | * @param postalCountryCode the given country code | |
| 28 | * @return a country object with the given country code | |
| 29 | */ | |
| 30 | Country getByPrimaryId(String postalCountryCode); | |
| 31 | ||
| 32 | /** | |
| 33 | * get a country object based on the given country code. If the postal country code of the existing country is same as the given | |
| 34 | * country code, return the existing country; otherwise, retrieve a new country object. | |
| 35 | * | |
| 36 | * @param alternatePostalCountryCode the given country code | |
| 37 | * @param existingCountry the given existing ccountry | |
| 38 | * @return a country object with the given country code if necessary | |
| 39 | */ | |
| 40 | Country getByAlternatePostalCountryCodeIfNecessary(String alternatePostalCountryCode, Country existingCountry); | |
| 41 | ||
| 42 | /** | |
| 43 | * get a country object based on the given country code. | |
| 44 | * | |
| 45 | * @param alternatePostalCountryCode the given country code | |
| 46 | * @return a country object with the given country code | |
| 47 | */ | |
| 48 | Country getByAlternatePostalCountryCode(String alternatePostalCountryCode); | |
| 49 | ||
| 50 | /** | |
| 51 | * get a country object based on the given country code. If the postal country code of the existing country is same as the given | |
| 52 | * country code, return the existing country; otherwise, retrieve a new country object. | |
| 53 | * | |
| 54 | * @param postalCountryCode the given country code | |
| 55 | * @param existingCountry the given existing ccountry | |
| 56 | * @return a country object with the given country code if necessary | |
| 57 | */ | |
| 58 | Country getByPrimaryIdIfNecessary(String postalCountryCode, Country existingCountry); | |
| 59 | ||
| 60 | /** | |
| 61 | * get the system default country, which is configured as a system parameter | |
| 62 | * @return the system default country | |
| 63 | */ | |
| 64 | Country getDefaultCountry(); | |
| 65 | ||
| 66 | /** | |
| 67 | * get all countries that are note restricated | |
| 68 | * | |
| 69 | * @return all countries that are note restricated | |
| 70 | */ | |
| 71 | List<Country> findAllCountriesNotRestricted(); | |
| 72 | ||
| 73 | /** | |
| 74 | * get all countries | |
| 75 | * | |
| 76 | * @return all countries | |
| 77 | */ | |
| 78 | List<Country> findAllCountries(); | |
| 79 | } |