Class PostalCode.Builder
java.lang.Object
org.kuali.rice.location.api.postalcode.PostalCode.Builder
- All Implemented Interfaces:
Serializable,Inactivatable,Coded,Versioned,ModelBuilder,PostalCodeContract
- Enclosing class:
PostalCode
public static class PostalCode.Builder
extends Object
implements PostalCodeContract, ModelBuilder, Serializable
This builder constructs a PostalCode enforcing the constraints of the
PostalCodeContract.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbuild()static PostalCode.Buildercreates a PostalCode builder with the required fields.static PostalCode.Buildercreate(PostalCodeContract contract) creates a PostalCode builder from an existingPostalCodeContract.This the postal state code for the PostalCode.getCode()This the postal country code for the PostalCode.This the county code for the PostalCode.This the postal state code for the PostalCode.booleanisActive()voidsetActive(boolean active) voidsetCityName(String cityName) Sets the name of the city associated with the PostalCode to be created from this Builder.voidSets the code for the PostalCode created from this Builder.voidsetCountryCode(String countryCode) Sets the Country code to be associated with the PostalCode created from this Builder.voidsetCountyCode(String countyCode) Sets the County code to be associated with the PostalCode created from this Builder.voidsetStateCode(String stateCode) Sets the State code to be associated with the PostalCode created from this Builder.voidsetVersionNumber(Long versionNumber)
-
Method Details
-
create
creates a PostalCode builder with the required fields. -
create
creates a PostalCode builder from an existingPostalCodeContract. -
getCode
-
setCode
Sets the code for the PostalCode created from this Builder.- Parameters:
code- String code for the PostalCode- Throws:
IllegalArgumentException- if the passed in code is null or a blank String.
-
getCityName
Description copied from interface:PostalCodeContractThis the postal state code for the PostalCode. This can be null.- Specified by:
getCityNamein interfacePostalCodeContract- Returns:
- postal state code
-
setCityName
Sets the name of the city associated with the PostalCode to be created from this Builder.- Parameters:
cityName- String representing the name of the City- Throws:
IllegalArgumentException- if the passed in cityname is null or a blank String.
-
getCountryCode
Description copied from interface:PostalCodeContractThis the postal country code for the PostalCode. This cannot be null or a blank string.- Specified by:
getCountryCodein interfacePostalCodeContract- Returns:
- postal country code
-
setCountryCode
Sets the Country code to be associated with the PostalCode created from this Builder.- Parameters:
countryCode- String representing the Country Code- Throws:
IllegalArgumentException- if the passed in countryCode is null or a blank String.- See Also:
-
getStateCode
Description copied from interface:PostalCodeContractThis the postal state code for the PostalCode. This can be null.- Specified by:
getStateCodein interfacePostalCodeContract- Returns:
- postal state code
-
setStateCode
Sets the State code to be associated with the PostalCode created from this Builder.- Parameters:
stateCode- String representing the State code- Throws:
IllegalArgumentException- if the passed in stateCode is null or a blank String.- See Also:
-
getCountyCode
Description copied from interface:PostalCodeContractThis the county code for the PostalCode. This cannot be null.- Specified by:
getCountyCodein interfacePostalCodeContract- Returns:
- postal state code
-
setCountyCode
Sets the County code to be associated with the PostalCode created from this Builder.- Parameters:
countyCode- String representing the County code- Throws:
IllegalArgumentException- if the passed in countyCode is null or a blank String.- See Also:
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceInactivatable
-
setActive
public void setActive(boolean active) -
getVersionNumber
- Specified by:
getVersionNumberin interfaceVersioned
-
setVersionNumber
-
build
- Specified by:
buildin interfaceModelBuilder
-