java.lang.ObjectValidState
public class ValidState
The ValidState class definition validates state abbreviations entered by users.
Constructor Summary | |
---|---|
ValidState(java.lang.String state)
The constructor sets initial value for the state abbreviation. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ValidState(java.lang.String state)
state
- the state abbreviationMethod Detail |
---|
public java.lang.String getState()
public void setState(java.lang.String state)
state
- the state abbreviationpublic java.lang.String toString()
toString
in class java.lang.Object