org.kuali.rice.location.api.country
Class Country.Builder

java.lang.Object
  extended by org.kuali.rice.location.api.country.Country.Builder
All Implemented Interfaces:
Serializable, Inactivatable, Coded, Versioned, ModelBuilder, CountryContract
Enclosing class:
Country

public static class Country.Builder
extends Object
implements CountryContract, ModelBuilder, Serializable

Builder for immutable Country objects.

See Also:
Serialized Form

Method Summary
 Country build()
          Returns an instance of the object being built by this builder based on the current state of the builder.
static Country.Builder create(CountryContract cc)
           
static Country.Builder create(String code, String name)
           
static Country.Builder create(String code, String alternatePostalCode, String name, boolean restricted, boolean active)
           
 String getAlternateCode()
          An alternative country code to represent a country.
 String getCode()
          The code value for this object.
 String getName()
          A full, familiar, name of a country.
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isActive()
          The active indicator for an object.
 boolean isRestricted()
          Value representing whether a country is restricted.
 void setActive(boolean active)
          Sets the active property.
 void setAlternateCode(String alternatePostalCode)
          Sets the optional alternatePostalCode property
 void setCode(String code)
          Sets code property.
 void setName(String name)
          Sets the optional name property.
 void setRestricted(boolean restricted)
          Sets the restrictedProperty
 void setVersionNumber(Long versionNumber)
          Sets the versionNumber property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Country.Builder create(String code,
                                     String name)

create

public static Country.Builder create(String code,
                                     String alternatePostalCode,
                                     String name,
                                     boolean restricted,
                                     boolean active)

create

public static Country.Builder create(CountryContract cc)

build

public Country 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

setCode

public void setCode(String code)
Sets code property.

Parameters:
code - required to be not null and not empty.

getCode

public String getCode()
Description copied from interface: CountryContract
The code value for this object. In general a code value cannot be null or a blank string. An abbreviated String representing the unique identifying code for a given country. This code correlates directly to the alpha-2 country codes from the ISO-3166-1-alpha-2 standard.

This property is required to exist.

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

setAlternateCode

public void setAlternateCode(String alternatePostalCode)
Sets the optional alternatePostalCode property

Parameters:
alternatePostalCode -

getAlternateCode

public String getAlternateCode()
Description copied from interface: CountryContract
An alternative country code to represent a country. This code correlats directly to the alpha-3 codes from the ISO_3166-1-alpha-3 standard.

This property is optional

Specified by:
getAlternateCode in interface CountryContract
Returns:
The alternate country code if it exists. null is returned if an alternate code does not exist.

setName

public void setName(String name)
Sets the optional name property.

Parameters:
name -

getName

public String getName()
Description copied from interface: CountryContract
A full, familiar, name of a country.

This property is optional

Specified by:
getName in interface CountryContract
Returns:
The name of a country if it exists. null is returned if a full name does not exist.

setActive

public void setActive(boolean active)
Sets the active property.

Parameters:
active -

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.

setVersionNumber

public void setVersionNumber(Long versionNumber)
Sets the versionNumber property.

Parameters:
versionNumber -

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

setRestricted

public void setRestricted(boolean restricted)
Sets the restrictedProperty

Parameters:
restricted -

isRestricted

public boolean isRestricted()
Description copied from interface: CountryContract
Value representing whether a country is restricted.

The meaning of restricted for a country varies depending upon the implementer - for instance if a country may not be used in the address of a Vendor.

The default value of this property is false.

Specified by:
isRestricted in interface CountryContract
Returns:
if a country is restricted.


Copyright © 2005–2015 The Kuali Foundation. All rights reserved.