public static Integer stringToInteger(String s,Integer defaultValue){
  try {
    return Integer.parseInt(s);
  }
 catch (  NumberFormatException nfe) {
    return defaultValue;
  }
}

public static Integer stringToInteger ( String s , Integer defaultValue ) { try { return Integer . parseInt ( s ) ; } catch ( NumberFormatException nfe ) { return defaultValue ; } }
convert a string to an integer , falling back to a defaultvalue if the string cannot be parsed . this is useful because there are issues passing an integer directly through uimafit to a component , and currently we need to pass it as a string and convert it .
