This code should be equivalent to writing a lot of if else checks as you suggested. Do you think the generated byte code would be any different ? 

I mean the function that would decide which cloning function to pick would do the same thing (there is no other way I can think of perhaps you can help). I am not sure but shouldn't branch prediction perform well in this case ?