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.
 PostalCodeQueryResults findPostalCodes(QueryByCriteria queryByCriteria)
          This method find PostalCodes based on a query criteria.
 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:
RiceIllegalArgumentException - country code or postal code value is blank

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:
RiceIllegalArgumentException - country code is blank

findPostalCodes

PostalCodeQueryResults findPostalCodes(QueryByCriteria queryByCriteria)
                                       throws RiceIllegalArgumentException
This method find PostalCodes based on a query criteria. The criteria cannot be null.

Parameters:
queryByCriteria - the criteria. Cannot be null.
Returns:
query results. will never return null.
Throws:
IllegalArgumentException - if the queryByCriteria is null
RiceIllegalArgumentException
Since:
2.0.1


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