private static Comparable<?> parsePropertyValue(String name,String value){
  if (PROPERTY_EVENT_TYPE.equals(name)) {
    return sEventTypeNameToValueMap.get(value);
  }
  final int propertyType=getPropertyType(name);
switch (propertyType) {
case PROPERTY_TYPE_BOOLEAN:
    return Boolean.valueOf(value);
case PROPERTY_TYPE_FLOAT:
  try {
    return Float.valueOf(value);
  }
 catch (  NumberFormatException nfe) {
    LogUtils.log(EventSpeechRule.class,Log.WARN,"Property '%s' not float.",name);
    return null;
  }
case PROPERTY_TYPE_INTEGER:
try {
  return Integer.valueOf(value);
}
 catch (NumberFormatException nfe) {
  LogUtils.log(EventSpeechRule.class,Log.WARN,"Property '%s' not int.",name);
  return null;
}
case PROPERTY_TYPE_STRING:
return value;
default :
throw new IllegalArgumentException("Unknown property: " + name);
}
}

private static Comparable < ? > parsePropertyValue ( String name , String value ) { if ( PROPERTY_EVENT_TYPE . equals ( name ) ) { return sEventTypeNameToValueMap . get ( value ) ; } final int propertyType = getPropertyType ( name ) ; switch ( propertyType ) { case PROPERTY_TYPE_BOOLEAN : return Boolean . valueOf ( value ) ; case PROPERTY_TYPE_FLOAT : try { return Float . valueOf ( value ) ; } catch ( NumberFormatException nfe ) { LogUtils . log ( EventSpeechRule . class , Log . WARN , "Property '%s' not float." , name ) ; return null ; } case PROPERTY_TYPE_INTEGER : try { return Integer . valueOf ( value ) ; } catch ( NumberFormatException nfe ) { LogUtils . log ( EventSpeechRule . class , Log . WARN , "Property '%s' not int." , name ) ; return null ; } case PROPERTY_TYPE_STRING : return value ; default : throw new IllegalArgumentException ( "Unknown property: " + name ) ; } }
parses a property according to its expected type . parsing failures are logged and null is returned .
