Align and improve Portmapping versions Step 2 21/93921/18
authorguillaume.lambert <guillaume.lambert@orange.com>
Thu, 26 Nov 2020 14:34:36 +0000 (15:34 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Mon, 14 Dec 2020 08:10:15 +0000 (08:10 +0000)
commitdb6727f8b92fa3b683383af5fee1b2e33e0319d1
treea38823f860379bbf57bd468e189a2067eaf910b4
parent853232de9e2c09133ddb7c1b91eda800fcf4d0e4
Align and improve Portmapping versions Step 2

- optimize some pieces of code, mainly by improving checks orders,
  and sometimes by reversing the logic too.
- gather preliminary checks and use "continue" in loop rather than
  else-if-blocks to ease indentation and optimizations
- use (YANG) enums and switch/case rather than (else-)if-blocks
- add some new protections
- get rid of @SuppressWarnings linelength checks
- points with TODO comments potential code mutualizations or alignments
- introduce checkPartnerPort function in Portmapping 1.2.1

JIRA: TRNSPRTPCE-353
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I91aadb74668cf7f4eb5689824dd33b92badcbe5f
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion121.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion221.java
common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion710.java