[REQ][Java] Enhance POJO generation with Optional
Created by: thoroughsoft
Is your feature request related to a problem? Please describe.
Currently a POJO is generated with either direct access returning null or through the proprietary JsonNullable class. It should also be possible to generate the POJO without the method returning null, that is, use Optional for this case instead. Since it has been discussed before in other threads, this enhancement does NOT mean replacing the usage of the JsonNullable class, only changing the returned data type from the standard get method to use Optional. The getXXX_JsonNullable class remains. This enhancement means that in most cases the proprietary JsonNullable class stays hidden from the rest of the code while at the same time offering the full api of Optional.
Describe the solution you'd like
By setting the parameter 'useOptionalInApi' the code generator automatically adds Optional to the get methods. Note the different name to the already existing 'useOptional' to avoid conflicting/undesired output.
Describe alternatives you've considered
Manually changing the code every time it is generated. How error prone is that...?
Additional context
The code is ready, including test cases.