public class ValidState
extends java.lang.Object
Constructor and Description |
---|
ValidState()
The constructor sets default value for the state abbreviation.
|
ValidState(java.lang.String state)
The constructor sets initial value for the state abbreviation.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getState()
Returns the state abbreviation field as a String
|
void |
setState(java.lang.String state)
Sets value for state abbreviation field which must be from the list
of 50 valid state abbreviations or the District of Columbia (DC).
|
java.lang.String |
toString()
Returns a String representation of the ValidState class which is the
formatted state abbreviation field with a preceding label.
|
public ValidState()
public ValidState(java.lang.String state)
state
- the state abbreviationpublic void setState(java.lang.String state)
state
- the state abbreviationpublic java.lang.String getState()
public java.lang.String toString()
toString
in class java.lang.Object