Align and improve Portmapping versions Step 2 35/94035/1
authorguillaume.lambert <guillaume.lambert@orange.com>
Thu, 26 Nov 2020 14:34:36 +0000 (15:34 +0100)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Thu, 17 Dec 2020 09:31:38 +0000 (09:31 +0000)
commit64837af1a7c138b2dd6c4ebf0555f9b4f8cc5b70
treea0395b13e2ed8e5907634cfe6532c84e7ac019c8
parentdc7a551ec0f22fb67a0cbeec06b8b7c8a18c813e
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
(cherry picked from commit db6727f8b92fa3b683383af5fee1b2e33e0319d1)
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