1 /* 2 * Copyright 2007-2009 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 org.kuali.rice.kns.bo.PostalCode; 19 20 public interface PostalCodeService { 21 22 /** 23 * get the postal code object based on the given postal code and default country code. The default country code is set up in 24 * the system. 25 * 26 * @param postalCode the given postal code 27 * @return the postal code object with the given postal code and default country code. 28 */ 29 public PostalCode getByPostalCodeInDefaultCountry(String postalCode); 30 31 /** 32 * get the postal zip code object based on the given postal code and country code 33 * 34 * @param postalCountryCode the given country code 35 * @param postalCode the given postal code 36 * @return the postal code object with the given postal code and country code. 37 */ 38 public PostalCode getByPrimaryId(String postalCountryCode, String postalCode); 39 40 /** 41 * get the postal code obpostalt based on the given postal code and default country code. The default country code is set up in 42 * the system. If the given postal postale is same as that of the given existing postal code, return the existing postal code; 43 * otherwise, retrieve a postal code object. 44 * 45 * @param postalCode the given postal code 46 * @param existingPostalCode the given existing postal code 47 * @return the postal code object with the given postal code and default country code if necessary 48 */ 49 public PostalCode getByPostalCodeInDefaultCountryIfNecessary(String postalCode, PostalCode existingPostalCode); 50 51 /** 52 * get the postal code object based on the given postal code and country code. If the given postal code and country code 53 * are same as those of the given existing postal code, return the existing postal code; otherwise, retrieve a postal code 54 * object. 55 * 56 * @param postalCountryCode the given country code 57 * @param postalCode the given postal code 58 * @param existingPostalCode the given existing postal code 59 * @return the postal code object with the given postal code and country code if necessary 60 */ 61 public PostalCode getByPrimaryIdIfNecessary(String postalCountryCode, String postalCode, PostalCode existingPostalCode); 62 }