org.kuali.rice.location.api.postalcode
Class PostalCode.Builder

java.lang.Object
  extended by 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:
Serialized Form

Method Summary
 PostalCode build()
          Returns an instance of the object being built by this builder based on the current state of the builder.
static PostalCode.Builder create(PostalCodeContract contract)
          creates a PostalCode builder from an existing PostalCodeContract.
static PostalCode.Builder create(String code, String countryCode)
          creates a PostalCode builder with the required fields.
 String getCityName()
          This the postal state code for the PostalCode.
 String getCode()
          The code value for this object.
 String getCountryCode()
          This the postal country code for the PostalCode.
 String getCountyCode()
          This the county code for the PostalCode.
 String getStateCode()
          This the postal state code for the PostalCode.
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isActive()
          The active indicator for an object.
 void setActive(boolean active)
           
 void setCityName(String cityName)
          Sets the name of the city associated with the PostalCode to be created from this Builder.
 void setCode(String code)
          Sets the code for the PostalCode created from this Builder.
 void setCountryCode(String countryCode)
          Sets the Country code to be associated with the PostalCode created from this Builder.
 void setCountyCode(String countyCode)
          Sets the County code to be associated with the PostalCode created from this Builder.
 void setStateCode(String stateCode)
          Sets the State code to be associated with the PostalCode created from this Builder.
 void setVersionNumber(Long versionNumber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static PostalCode.Builder create(String code,
                                        String countryCode)
creates a PostalCode builder with the required fields.


create

public static PostalCode.Builder create(PostalCodeContract contract)
creates a PostalCode builder from an existing PostalCodeContract.


getCode

public String getCode()
Description copied from interface: Coded
The code value for this object. In general a code value cannot be null or a blank string.

Specified by:
getCode in interface Coded
Returns:
the code value for this object.

setCode

public void setCode(String code)
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

public String getCityName()
Description copied from interface: PostalCodeContract
This the postal state code for the PostalCode. This can be null.

Specified by:
getCityName in interface PostalCodeContract
Returns:
postal state code

setCityName

public void setCityName(String cityName)
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

public String getCountryCode()
Description copied from interface: PostalCodeContract
This the postal country code for the PostalCode. This cannot be null or a blank string.

Specified by:
getCountryCode in interface PostalCodeContract
Returns:
postal country code

setCountryCode

public void setCountryCode(String countryCode)
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:
CountryContract

getStateCode

public String getStateCode()
Description copied from interface: PostalCodeContract
This the postal state code for the PostalCode. This can be null.

Specified by:
getStateCode in interface PostalCodeContract
Returns:
postal state code

setStateCode

public void setStateCode(String stateCode)
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:
StateContract

getCountyCode

public String getCountyCode()
Description copied from interface: PostalCodeContract
This the county code for the PostalCode. This cannot be null.

Specified by:
getCountyCode in interface PostalCodeContract
Returns:
postal state code

setCountyCode

public void setCountyCode(String countyCode)
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:
CountyContract

isActive

public boolean isActive()
Description copied from interface: Inactivatable
The active indicator for an object.

Specified by:
isActive in interface Inactivatable
Returns:
true if active false if not.

setActive

public void setActive(boolean active)

getVersionNumber

public Long getVersionNumber()
Description copied from interface: Versioned
Returns the version number for this object. In general, this value should only be null if the object has not yet been stored to a persistent data store. This version number is generally used for the purposes of optimistic locking.

Specified by:
getVersionNumber in interface Versioned
Returns:
the version number, or null if one has not been assigned yet

setVersionNumber

public void setVersionNumber(Long versionNumber)

build

public PostalCode build()
Description copied from interface: ModelBuilder
Returns an instance of the object being built by this builder based on the current state of the builder. It should be possible to invoke this method more than once on the same builder. It should never return null;

Specified by:
build in interface ModelBuilder
Returns:
an instance of the object being built by this builder, should never return null


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