public StateCodeDataType . Enum getStateCodeDataType ( String countryAlternateCode , String stateName ) { StateCodeDataType . Enum stateCodeDataType = null ; StateContract state = s2SLocationService . getStateFromName ( countryAlternateCode , stateName ) ; if ( state != null ) { StringBuilder stateDetail = new StringBuilder ( ) ; stateDetail . append ( state . getCode ( ) ) ; stateDetail . append ( ": " ) ; String stateNameCapital = WordUtils . capitalizeFully ( state . getName ( ) ) ; stateNameCapital = stateNameCapital . replace ( " Of " , " of " ) ; stateNameCapital = stateNameCapital . replace ( " The " , " the " ) ; stateNameCapital = stateNameCapital . replace ( " And " , " and " ) ; stateDetail . append ( stateNameCapital ) ; stateCodeDataType = StateCodeDataType . Enum . forString ( stateDetail . toString ( ) ) ; } return stateCodeDataType ; }
Create a StateCodeDataType . Enum as defined in UniversalCodes 2 . 0 from the given name of the state .