Refactor style b/c of service models 10.1 update
Some pieces of the current code do not follow any coherent coding style
pattern.
Some others still use old Java coding style patterns,
mainly old patterns used before builders and setters could be cascaded.
A coherent and clean coding style matters because
- it eases the code maintenance and evolution
- it also helps detect errors or possible optimizations
For this reason, coding style issues should preferably be adressed
before any in-depth modifications such as API migrations.
And if not possible, at least afterwards.
This is particularly true with the YANG models API used here.
They generate long namespaces and long builders/setters structures
that can quickly burden the code and complicate its reading or analysis.
As a consequence, the style of some pieces of code was reviewed here to
- correct indentations
- rework LF positions
- fix split NS and revision dates
- add ternary operator where it makes senses
- rearrange and cascade builders and setters
Once that done, some optimizations have been proposed on the fly to:
- remove some intermediate variables that are not needed
- remove related imports no more used
- add imports to avoid to use long NS in code blocks
- etc
Finally add TODO comments on few places that might need to be reworked.
https://en.wikipedia.org/wiki/Programming_style
JIRA: TRNSPRTPCE-586 TRNSPRTPCE-205
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I14f5f40dfdf97fa0f32139d384db878e2932fc04