public static int stringToActionData(String str){
  if (str.equals(rbx.getString("TurnoutClosed"))) {
    return Turnout.CLOSED;
  }
 else   if (str.equals(rbx.getString("TurnoutThrown"))) {
    return Turnout.THROWN;
  }
 else   if (str.equals(Bundle.getMessage("SensorStateActive"))) {
    return Sensor.ACTIVE;
  }
 else   if (str.equals(Bundle.getMessage("SensorStateInactive"))) {
    return Sensor.INACTIVE;
  }
 else   if (str.equals(rbx.getString("LightOn"))) {
    return Light.ON;
  }
 else   if (str.equals(rbx.getString("LightOff"))) {
    return Light.OFF;
  }
 else   if (str.equals(rbx.getString("TurnoutUnlock"))) {
    return Turnout.UNLOCKED;
  }
 else   if (str.equals(rbx.getString("TurnoutLock"))) {
    return Turnout.LOCKED;
  }
 else   if (str.equals(Bundle.getMessage("SignalHeadStateRed"))) {
    return SignalHead.RED;
  }
 else   if (str.equals(Bundle.getMessage("SignalHeadStateYellow"))) {
    return SignalHead.YELLOW;
  }
 else   if (str.equals(Bundle.getMessage("SignalHeadStateGreen"))) {
    return SignalHead.GREEN;
  }
 else   if (str.equals(Bundle.getMessage("SignalHeadStateDark"))) {
    return SignalHead.DARK;
  }
 else   if (str.equals(Bundle.getMessage("SignalHeadStateFlashingRed"))) {
    return SignalHead.FLASHRED;
  }
 else   if (str.equals(Bundle.getMessage("SignalHeadStateFlashingYellow"))) {
    return SignalHead.FLASHYELLOW;
  }
 else   if (str.equals(Bundle.getMessage("SignalHeadStateFlashingGreen"))) {
    return SignalHead.FLASHGREEN;
  }
 else   if (str.equals(Bundle.getMessage("SignalHeadStateLunar"))) {
    return SignalHead.LUNAR;
  }
 else   if (str.equals(Bundle.getMessage("SignalHeadStateFlashingLunar"))) {
    return SignalHead.FLASHLUNAR;
  }
 else   if (str.equals(rbx.getString("AudioSourcePlay"))) {
    return Audio.CMD_PLAY;
  }
 else   if (str.equals(rbx.getString("AudioSourceStop"))) {
    return Audio.CMD_STOP;
  }
 else   if (str.equals(rbx.getString("AudioSourcePlayToggle"))) {
    return Audio.CMD_PLAY_TOGGLE;
  }
 else   if (str.equals(rbx.getString("AudioSourcePause"))) {
    return Audio.CMD_PAUSE;
  }
 else   if (str.equals(rbx.getString("AudioSourceResume"))) {
    return Audio.CMD_RESUME;
  }
 else   if (str.equals(rbx.getString("AudioSourcePauseToggle"))) {
    return Audio.CMD_PAUSE_TOGGLE;
  }
 else   if (str.equals(rbx.getString("AudioSourceRewind"))) {
    return Audio.CMD_REWIND;
  }
 else   if (str.equals(rbx.getString("AudioSourceFadeIn"))) {
    return Audio.CMD_FADE_IN;
  }
 else   if (str.equals(rbx.getString("AudioSourceFadeOut"))) {
    return Audio.CMD_FADE_OUT;
  }
 else   if (str.equals(rbx.getString("AudioResetPosition"))) {
    return Audio.CMD_RESET_POSITION;
  }
  if (str.length() > 0) {
    log.warn("Unexpected parameter to stringToActionData(" + str + ")");
  }
  return -1;
}

public static int stringToActionData ( String str ) { if ( str . equals ( rbx . getString ( "TurnoutClosed" ) ) ) { return Turnout . CLOSED ; } else if ( str . equals ( rbx . getString ( "TurnoutThrown" ) ) ) { return Turnout . THROWN ; } else if ( str . equals ( Bundle . getMessage ( "SensorStateActive" ) ) ) { return Sensor . ACTIVE ; } else if ( str . equals ( Bundle . getMessage ( "SensorStateInactive" ) ) ) { return Sensor . INACTIVE ; } else if ( str . equals ( rbx . getString ( "LightOn" ) ) ) { return Light . ON ; } else if ( str . equals ( rbx . getString ( "LightOff" ) ) ) { return Light . OFF ; } else if ( str . equals ( rbx . getString ( "TurnoutUnlock" ) ) ) { return Turnout . UNLOCKED ; } else if ( str . equals ( rbx . getString ( "TurnoutLock" ) ) ) { return Turnout . LOCKED ; } else if ( str . equals ( Bundle . getMessage ( "SignalHeadStateRed" ) ) ) { return SignalHead . RED ; } else if ( str . equals ( Bundle . getMessage ( "SignalHeadStateYellow" ) ) ) { return SignalHead . YELLOW ; } else if ( str . equals ( Bundle . getMessage ( "SignalHeadStateGreen" ) ) ) { return SignalHead . GREEN ; } else if ( str . equals ( Bundle . getMessage ( "SignalHeadStateDark" ) ) ) { return SignalHead . DARK ; } else if ( str . equals ( Bundle . getMessage ( "SignalHeadStateFlashingRed" ) ) ) { return SignalHead . FLASHRED ; } else if ( str . equals ( Bundle . getMessage ( "SignalHeadStateFlashingYellow" ) ) ) { return SignalHead . FLASHYELLOW ; } else if ( str . equals ( Bundle . getMessage ( "SignalHeadStateFlashingGreen" ) ) ) { return SignalHead . FLASHGREEN ; } else if ( str . equals ( Bundle . getMessage ( "SignalHeadStateLunar" ) ) ) { return SignalHead . LUNAR ; } else if ( str . equals ( Bundle . getMessage ( "SignalHeadStateFlashingLunar" ) ) ) { return SignalHead . FLASHLUNAR ; } else if ( str . equals ( rbx . getString ( "AudioSourcePlay" ) ) ) { return Audio . CMD_PLAY ; } else if ( str . equals ( rbx . getString ( "AudioSourceStop" ) ) ) { return Audio . CMD_STOP ; } else if ( str . equals ( rbx . getString ( "AudioSourcePlayToggle" ) ) ) { return Audio . CMD_PLAY_TOGGLE ; } else if ( str . equals ( rbx . getString ( "AudioSourcePause" ) ) ) { return Audio . CMD_PAUSE ; } else if ( str . equals ( rbx . getString ( "AudioSourceResume" ) ) ) { return Audio . CMD_RESUME ; } else if ( str . equals ( rbx . getString ( "AudioSourcePauseToggle" ) ) ) { return Audio . CMD_PAUSE_TOGGLE ; } else if ( str . equals ( rbx . getString ( "AudioSourceRewind" ) ) ) { return Audio . CMD_REWIND ; } else if ( str . equals ( rbx . getString ( "AudioSourceFadeIn" ) ) ) { return Audio . CMD_FADE_IN ; } else if ( str . equals ( rbx . getString ( "AudioSourceFadeOut" ) ) ) { return Audio . CMD_FADE_OUT ; } else if ( str . equals ( rbx . getString ( "AudioResetPosition" ) ) ) { return Audio . CMD_RESET_POSITION ; } if ( str . length ( ) > 0 ) { log . warn ( "Unexpected parameter to stringToActionData(" + str + ")" ) ; } return - 1 ; }
identifies action data from text string note : if string does not correspond to an action data as defined in conditionalaction , returns - 1 .
