public List < Serializable > getValues ( String text , String type ) throws NumberFormatException { List < Serializable > list = new ArrayList < Serializable > ( ) ; String [ ] values = text . split ( DELIM ) ; for ( String v : values ) { Serializable value ; if ( QueryParameter . INTEGER_VALUE . equals ( type ) ) { value = Integer . parseInt ( v ) ; } else if ( QueryParameter . BYTE_VALUE . equals ( type ) ) { value = Byte . parseByte ( v ) ; } else if ( QueryParameter . SHORT_VALUE . equals ( type ) ) { value = Short . parseShort ( v ) ; } else if ( QueryParameter . LONG_VALUE . equals ( type ) ) { value = Long . parseLong ( v ) ; } else if ( QueryParameter . FLOAT_VALUE . equals ( type ) ) { value = Float . parseFloat ( v ) ; } else if ( QueryParameter . DOUBLE_VALUE . equals ( type ) ) { value = Double . parseDouble ( v ) ; } else if ( QueryParameter . BIGDECIMAL_VALUE . equals ( type ) ) { value = new BigDecimal ( v ) ; } else { // String value = v ; } list . add ( value ) ; } return list ; }
number and string values can be separated by semicolon delimiter