public static Object convertToParameterValues(Object object){
  Collection<Object> collection;
  if (object instanceof Object[]) {
    collection=Arrays.asList((Object[])object);
  }
 else   if (object instanceof Collection) {
    collection=(Collection<Object>)object;
  }
 else {
    LOGGER.warn("Unable to convert value, ignoring");
    return new Object[]{};
  }
  List<Object> s=new LinkedList<Object>();
  for (  Object o : collection) {
    Object converted=convertToParameterValue(o);
    if (converted instanceof Object[]) {
      s.addAll(Arrays.asList((Object[])converted));
    }
 else {
      s.add(converted);
    }
  }
  return s.toArray(new Object[s.size()]);
}

public static Object convertToParameterValues ( Object object ) { Collection < Object > collection ; if ( object instanceof Object [ ] ) { collection = Arrays . asList ( ( Object [ ] ) object ) ; } else if ( object instanceof Collection ) { collection = ( Collection < Object > ) object ; } else { LOGGER . warn ( "Unable to convert value, ignoring" ) ; return new Object [ ] { } ; } List < Object > s = new LinkedList < Object > ( ) ; for ( Object o : collection ) { Object converted = convertToParameterValue ( o ) ; if ( converted instanceof Object [ ] ) { s . addAll ( Arrays . asList ( ( Object [ ] ) converted ) ) ; } else { s . add ( converted ) ; } } return s . toArray ( new Object [ s . size ( ) ] ) ; }
converts an array / collection of values ( the object ) to a parameter values array . resources should not be converted . use via converttoparametervalue ( to deal with non - lists )
