I see this in some code , and I have a hunch it is not a good practice. What are your opinions ?
@RestController
public class AddController {
@RequestMapping(value="/Add", method = RequestMethod.POST)
public ActionResponse add(@Valid @RequestBody AddRequest request) {
// Method does as much as necessary
}
static class AddCRequest {
public String parameter1;
public long parameter2;
public long parameter3;
}
}
}
Having the static nested class as a parameter of of the methdos of the service , is it good ? Static implies only one instance of the class ? How will it behave with concurrency ? A very good theorical-technical explanation would be appreciated.