I have a function (findByNames
) that accepts spreading parameter like the example below :
List<Users> findByNames(String... names)
{
...
}
And as parameter i have a list :
List<String> names = asList("john","abraham");
So i would like to convert the names
list to spreading object to use findByNames
function, is that possible using Java 8 ?
I tried this solution :
MapUtils.getMap(names.toArray(new String[names.size()]))
but it's not working !
Thank's for you' time.