Make filters on TOSCA entities generic 74/117574/1
authorliamfallon <liam.fallon@est.tech>
Sun, 7 Feb 2021 15:20:23 +0000 (15:20 +0000)
committerliamfallon <liam.fallon@est.tech>
Sun, 7 Feb 2021 15:20:28 +0000 (15:20 +0000)
commit0b0fd8d7c890a75ee1fe829c68b92cf670a4a29f
treeaf4541fb9f4735055db79b69fb68fc1b6265eb8e
parentfdaa8dc48d80d14177d9c955160e7534be505192
Make filters on TOSCA entities generic

The classes PolicyTypeFilter and PolicyFilter only work on Policy types
and policies. However they just filter on name/version/type/typeversion
so there is no reason that the filters could not be applied to other
entities.

This commit adapts the PolicyTypeFilter to EntityFilter and PolicyFilter
to TypedEntityFilter, so the filters can be applied to collections of
any ToscaEntity class.

Issue-ID: POLICY-2995
Change-Id: Ibf12c757758d31ec3075119c56243e0abcf259bf
Signed-off-by: liamfallon <liam.fallon@est.tech>
main/src/main/java/org/onap/policy/api/main/rest/provider/PolicyProvider.java
main/src/main/java/org/onap/policy/api/main/rest/provider/PolicyTypeProvider.java
main/src/main/java/org/onap/policy/api/main/startstop/ApiDatabaseInitializer.java
main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java