1
I have a set of functions to configure a set of parameters in Java like this:
public void Util.setParametros(Integer par) {}
public void Util.setParametros(String par) {}
public void Util.setParametros(Long par) {}
public void Util.setParametros(Double par) {}
public void Util.setParametros(Boolean par) {}
Now I have another function that uses this and receives an array of parameters with the various types it has. For example:
public List buscaPorWhere(String where, Object[] parametros)
And I’d need to know what kind he is so I could call the method that:
Util.setParametros((Integer) parametros[1]);
How could I do that?
getName()
nay.getSimpleName()
yes.– Victor Stafusa
I’ll edit the answer
– Pedro Laini
And note that String Switch only works from Java SE 1.7
– Filipe Miranda