Class PostalCode.Builder

java.lang.Object
org.kuali.rice.location.api.postalcode.PostalCode.Builder
All Implemented Interfaces:
Serializable, org.kuali.rice.core.api.mo.common.active.Inactivatable, org.kuali.rice.core.api.mo.common.Coded, org.kuali.rice.core.api.mo.common.Versioned, org.kuali.rice.core.api.mo.ModelBuilder, PostalCodeContract
Enclosing class:
PostalCode

public static class PostalCode.Builder extends Object implements PostalCodeContract, org.kuali.rice.core.api.mo.ModelBuilder, Serializable
This builder constructs a PostalCode enforcing the constraints of the PostalCodeContract.
See Also:
  • Method Details

    • 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()
      Specified by:
      getCode in interface org.kuali.rice.core.api.mo.common.Coded
    • 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:
    • 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:
    • 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:
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface org.kuali.rice.core.api.mo.common.active.Inactivatable
    • setActive

      public void setActive(boolean active)
    • getVersionNumber

      public Long getVersionNumber()
      Specified by:
      getVersionNumber in interface org.kuali.rice.core.api.mo.common.Versioned
    • setVersionNumber

      public void setVersionNumber(Long versionNumber)
    • build

      public PostalCode build()
      Specified by:
      build in interface org.kuali.rice.core.api.mo.ModelBuilder