org.kuali.rice.shareddata.api.county
Class County.Builder

java.lang.Object
  extended by org.kuali.rice.shareddata.api.county.County.Builder
All Implemented Interfaces:
Serializable, ImmutableInactivatable, Coded, Versioned, ModelBuilder, CountyContract
Enclosing class:
County

public static class County.Builder
extends Object
implements CountyContract, ModelBuilder, Serializable

This builder constructs an County enforcing the constraints of the CountyContract.

See Also:
Serialized Form

Field Summary
private  boolean active
           
private  String code
           
private  String countryCode
           
private  String name
           
private static long serialVersionUID
           
private  String stateCode
           
private  Long versionNumber
           
 
Constructor Summary
private County.Builder(String code, String name, String countryCode, String stateCode)
           
 
Method Summary
 County build()
          Returns an instance of the object being built by this builder based on the current state of the builder.
static County.Builder create(CountyContract contract)
          creates a County Builder from an existing CountyContract.
static County.Builder create(String code, String name, String countryCode, String stateCode)
          creates a County Builder with the required fields.
 String getCode()
          The code value for this object.
 String getCountryCode()
          This the postal country code for the County.
 String getName()
          This the name for the County.
 String getStateCode()
          This the postal state code for the County.
 Long getVersionNumber()
          Returns the version number for this object.
 boolean isActive()
          The active indicator for an object.
 void setActive(boolean active)
          Sets the active flag for the County created from this Builder.
 void setCode(String code)
          Sets the code to be used for the County created from this Builder.
 void setCountryCode(String countryCode)
          Sets the Country code to be associated with the County created from this Builder.
 void setName(String name)
          Sets the full name of the County created from this Builder.
 void setStateCode(String stateCode)
          Sets the State code to be associated with the County 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
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

code

private String code

name

private String name

countryCode

private String countryCode

stateCode

private String stateCode

active

private boolean active

versionNumber

private Long versionNumber
Constructor Detail

County.Builder

private County.Builder(String code,
                       String name,
                       String countryCode,
                       String stateCode)
Method Detail

create

public static County.Builder create(String code,
                                    String name,
                                    String countryCode,
                                    String stateCode)
creates a County Builder with the required fields.


create

public static County.Builder create(CountyContract contract)
creates a County Builder from an existing CountyContract.


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 to be used for the County created from this Builder.

Parameters:
code - String code for a County
Throws:
IllegalArgumentException - if the passed in code is null or a blank String.

getName

public String getName()
Description copied from interface: CountyContract
This the name for the County. This cannot be null or a blank string.

Specified by:
getName in interface CountyContract
Returns:
name

setName

public void setName(String name)
Sets the full name of the County created from this Builder.

Parameters:
name - String representing the full name for the County
Throws:
IllegalArgumentException - if the passed in name is null or a blank String.

getCountryCode

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

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

setCountryCode

public void setCountryCode(String countryCode)
Sets the Country code to be associated with the County 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: CountyContract
This the postal state code for the County. This cannot be null or a blank string.

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

setStateCode

public void setStateCode(String stateCode)
Sets the State code to be associated with the County 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

isActive

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

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

setActive

public void setActive(boolean active)
Sets the active flag for the County created from this Builder.

Parameters:
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 County 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 © 2004-2011 The Kuali Foundation. All Rights Reserved.