Java JavaBean, Java (POJO), . :
void mymethod (Parameters parametersObject)
and JavaBean parameters will have setParam1 (...), setParam2 (...), setParam3 (...), etc. and may even perform some basic internal validation, provide default values, etc.
If you do not want to go through the creation of the Parameters object, use Map, but then you will have to do additional checking inside your method for the absence of parameters. In addition, the keys to the card must be well known, that is, known both outside the method and inside the method.
source
share