Closed FabiKo117 closed 4 years ago
I have implemented Lombok in our code. You can see the changes here #57. I used only annotations for getters, setters and constructors.
Complex Constructs cannot be handled, e.g.:
public AggregateRequestExecutor(RequestResource requestResource, HttpServletRequest servletRequest, HttpServletResponse servletResponse, boolean isDensity) { super(servletRequest, servletResponse); this.requestResource = requestResource; inputProcessor = new InputProcessor(servletRequest, true, isDensity); processingData = inputProcessor.getProcessingData(); }
It could be possible to use the builder annotations in order to build objects instead of calling constructors but IMHO this way doesn't reduce verbosity and some changes has to be done in the code itself.
It also offers other functionalities like an annotation for close() methods in finally
brackets, an annotation for toString methods, etc. But they would not be really useful for us, since the use of them is really seldom in the ohsome API.
IMHO Lombok is very useful for us for getters/setters and (not complex) constructors since it really reduces verbosity. If you like you can already merge the branch into master. I can open a confluence page about Lombok functionalities which should be used in the ohsome API.
Nice 👍 I'll have a look at it this afternoon.
See https://www.baeldung.com/intro-to-project-lombok
Could be used in response classes to reduce the code there.