public static Object normalizeIntAndLongValues(String data,DataType actualDataType){
  if (null == data) {
    return null;
  }
  try {
    Object parsedValue=null;
switch (actualDataType) {
case INT:
      parsedValue=Integer.parseInt(data);
    break;
case LONG:
  parsedValue=Long.parseLong(data);
break;
default :
return data;
}
if (null != parsedValue) {
return data;
}
return null;
}
 catch (NumberFormatException ex) {
return null;
}
}

public static Object normalizeIntAndLongValues ( String data , DataType actualDataType ) { if ( null == data ) { return null ; } try { Object parsedValue = null ; switch ( actualDataType ) { case INT : parsedValue = Integer . parseInt ( data ) ; break ; case LONG : parsedValue = Long . parseLong ( data ) ; break ; default : return data ; } if ( null != parsedValue ) { return data ; } return null ; } catch ( NumberFormatException ex ) { return null ; } }
below method will be used to basically to know whether any non parseable data is present or not . if present then return null so that system can process to default null member value .
