Make filters on TOSCA entities generic
[policy/models.git] / models-tosca / src / main / java / org / onap / policy / models / tosca / authorative / concepts / ToscaEntityComparator.java
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2020 Nordix Foundation.
+ *  Copyright (C) 2020-2021 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,12 +23,12 @@ package org.onap.policy.models.tosca.authorative.concepts;
 import java.util.Comparator;
 
 /**
- * Compare two ToscaPolicy objects.
+ * Compare two ToscaEntity objects.
  */
-public class ToscaPolicyComparator implements Comparator<ToscaPolicy> {
+public class ToscaEntityComparator<T extends ToscaEntity> implements Comparator<T> {
 
     @Override
-    public int compare(final ToscaPolicy left, final ToscaPolicy right) {
+    public int compare(final ToscaEntity left, final ToscaEntity right) {
         return left.compareNameVersion(left, right);
     }
 }