Convert Model Exception to Runtime Exception 47/116947/3
authorliamfallon <liam.fallon@est.tech>
Mon, 18 Jan 2021 11:17:28 +0000 (11:17 +0000)
committerliamfallon <liam.fallon@est.tech>
Tue, 19 Jan 2021 14:47:37 +0000 (14:47 +0000)
commitf49a43f102d99edd269a49ee531b9a2194ac6937
tree68ac191e675ed05a4aeb1cc14f5a800dd9f4dd65
parent5b577fd7cc40eaad1a1e5db2d43ef9ffe820e9a2
Convert Model Exception to Runtime Exception

Sometimes the exception thrown by the database providers has to be
converted to a runtime exception, especiall if the database provider is
running in a thread (called by the rum() method that does not return
exceptions). It is convenient to have a constructor on the
PfModelRuntimeException class that takes a PfModelException class as its
argument, thus creating the runtime exception.

Also the mapMap method in pfUtils is updated to allow the key of the map
to be templated. By doing this, the utility can be used for maps that
are keyed with types other than String (such as UUID).

Issue-ID: POLICY-2971
Change-Id: Ib0b3678de531fd383753a1cd0ce47a06f4079ec0
Signed-off-by: liamfallon <liam.fallon@est.tech>
models-base/src/main/java/org/onap/policy/models/base/PfModelRuntimeException.java
models-base/src/main/java/org/onap/policy/models/base/PfUtils.java
models-base/src/test/java/org/onap/policy/models/base/ExceptionsTest.java