Exemplo n.º 1
0
 protected double doubleOfString(String string) {
   double retValue = 0;
   if (!CommonUtil.isNull(string)) {
     string = string.trim();
     try {
       retValue = Double.parseDouble(string);
     } catch (NumberFormatException e) {
       e.printStackTrace();
     }
   }
   return retValue;
 }
Exemplo n.º 2
0
 protected boolean booleanOfString(String string) {
   boolean flag = false;
   if (!CommonUtil.isNull(string)) {
     string = string.trim();
     flag =
         string.equalsIgnoreCase("Y")
             || string.equalsIgnoreCase("YES")
             || string.equalsIgnoreCase("TRUE")
             || string.equalsIgnoreCase("T");
   }
   return flag;
 }