Complete filters for Database Fetches
[policy/models.git] / models-pdp / src / main / java / org / onap / policy / models / pdp / concepts / PdpGroup.java
index a59d1af..9665fd4 100644 (file)
@@ -40,7 +40,7 @@ import org.onap.policy.models.pdp.enums.PdpState;
  */
 @Data
 @NoArgsConstructor
-public class PdpGroup implements PfNameVersion {
+public class PdpGroup implements PfNameVersion, Comparable<PdpGroup> {
     private String name;
     private String version;
     private String description;
@@ -67,4 +67,9 @@ public class PdpGroup implements PfNameVersion {
         this.properties = (source.properties == null ? null : new LinkedHashMap<>(source.properties));
         this.pdpSubgroups = PfUtils.mapList(source.pdpSubgroups, PdpSubGroup::new);
     }
+
+    @Override
+    public int compareTo(final PdpGroup other) {
+        return compareNameVersion(this, other);
+    }
 }