org.kuali.rice.shareddata.api.state
Class State

java.lang.Object
  extended by org.kuali.rice.shareddata.api.state.State
All Implemented Interfaces:
Serializable, ImmutableInactivatable, Coded, Versioned, ModelObjectBasic, ModelObjectComplete, StateContract

public final class State
extends Object
implements StateContract, ModelObjectComplete

POJO implementation of CountryContract that is immutable. Instances of State can be (un)marshalled to and from XML.

See Also:
StateContract, Serialized Form

Nested Class Summary
static class State.Builder
          This builder constructs a State enforcing the constraints of the StateContract.
(package private) static class State.Constants
          Defines some internal constants used on this class.
(package private) static class State.Elements
          A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
 
Field Summary
private  Collection<Element> _futureElements
           
private  boolean active
           
private  String code
           
private  String countryCode
           
private  String name
           
private static long serialVersionUID
           
private  Long versionNumber
           
 
Constructor Summary
private State()
          This constructor should never be called except during JAXB unmarshalling.
private State(State.Builder builder)
           
 
Method Summary
 boolean equals(Object obj)
          All "Complete" model object's should adhere to the ModelObjectComplete.equals(Object) contract.
 String getCode()
          The code value for this object.
 String getCountryCode()
          This the postal country code for the State.
 String getName()
          This the postal name for the State.
 Long getVersionNumber()
          Returns the version number for this object.
 int hashCode()
          All "Complete" model object's should adhere to the ModelObjectComplete.hashCode() contract.
 boolean isActive()
          The active indicator for an object.
 String toString()
          This will return a proper string representation of the Model Object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

code

private final String code

name

private final String name

countryCode

private final String countryCode

active

private final boolean active

versionNumber

private final Long versionNumber

_futureElements

private final Collection<Element> _futureElements
Constructor Detail

State

private State()
This constructor should never be called except during JAXB unmarshalling.


State

private State(State.Builder builder)
Method Detail

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.

getName

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

Specified by:
getName in interface StateContract
Returns:
postal name

getCountryCode

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

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

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.

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

hashCode

public int hashCode()
Description copied from interface: ModelObjectComplete
All "Complete" model object's should adhere to the ModelObjectComplete.hashCode() contract.

Specified by:
hashCode in interface ModelObjectComplete
Overrides:
hashCode in class Object
Returns:
the hashCode value

equals

public boolean equals(Object obj)
Description copied from interface: ModelObjectComplete
All "Complete" model object's should adhere to the ModelObjectComplete.equals(Object) contract.

Specified by:
equals in interface ModelObjectComplete
Overrides:
equals in class Object
Parameters:
obj - to object to compare for equality
Returns:
if equal

toString

public String toString()
Description copied from interface: ModelObjectBasic
This will return a proper string representation of the Model Object. All of the fields comprising the "public" api should be represented in the return value.

Specified by:
toString in interface ModelObjectBasic
Overrides:
toString in class Object
Returns:
the string representation


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.