org.kuali.rice.location.api.postalcode
Interface PostalCodeService

All Known Implementing Classes:
PostalCodeServiceImpl

public interface PostalCodeService

Service for interacting with PostalCodes.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 List<PostalCode> findAllPostalCodesInCountry(String countryCode)
          Gets all the PostalCode for postal country code.
 PostalCode getPostalCode(String countryCode, String code)
          Gets a PostalCode from a postal country code and postal code value.
 

Method Detail

getPostalCode

@Cacheable(value="http://rice.kuali.org/location/v2_0/PostalCodeType",
           key="\'countryCode=\' + #p0 + \'|\' + \'code=\' + #p1")
PostalCode getPostalCode(String countryCode,
                                   String code)
                         throws RiceIllegalArgumentException
Gets a PostalCode from a postal country code and postal code value.

This method will return null if the state does not exist.

This method will return active or inactive postal codes.

Parameters:
countryCode - country code. cannot be blank.
code - postal code value. cannot be blank.
Returns:
a PostalCode or null
Throws:
IllegalArgumentException - country code or postal code value is blank
RiceIllegalArgumentException

findAllPostalCodesInCountry

@Cacheable(value="http://rice.kuali.org/location/v2_0/PostalCodeType",
           key="\'countryCode=\' + #p0")
List<PostalCode> findAllPostalCodesInCountry(String countryCode)
                                             throws RiceIllegalArgumentException
Gets all the PostalCode for postal country code.

This method will always return an immutable Collection even when no values exist.

This method will only return active postal codes.

Parameters:
countryCode - state code. cannot be blank.
Returns:
an immutable collection of states
Throws:
IllegalArgumentException - country code is blank
RiceIllegalArgumentException


Copyright © 2005-2011 The Kuali Foundation. All Rights Reserved.