java - List of duplicate elements generator -


is there java library lets generate list of n elements of same value.

something this:

list<t> getduplicateelementlist(int size, t value); 

for example

library.getduplicateelementlist(3, "?"); 

would return 3 elements list, each element equal "?";

i need create placeholders in clause prepared statement.

you can use following:

list<string> list = collections.ncopies(6, "abc"); 

as example, give list 6 times "abc" element.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -