I’ve a method which accepts 10 parameters and out of which 8 are mandatory. To check if the 8/10 are having not null values, i’ve a bunch of if-else statements for every parameter.
Writing this if-else code seems to be inelegant to me. Is there better way to do this?
Thank you
BC
You can use the apache commons-lang library to validate your input parameters: