Make it any difference to use in the following snippet boolean filterMode or Boolean filterMode? Are they any best practice ? Or its completley irrelevant?
@GetMapping
public NOTMATTER getResultByBoolean(
@RequestParam(value = "filterMode", required = false) boolean filterMode) {
//.....
}
Yes it will matter. As you have specified the parameter to be optional, if it is not supplied then default values will be different
// Boolean - default value is null
// boolean - default value is false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With