Fix sonars in models
[policy/models.git] / models-pdp / src / main / java / org / onap / policy / models / pdp / concepts / PdpStateChange.java
index d8f938b..98e2ee9 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
- *  Modifications Copyright (C) 2019 AT&T Intellectual Property.
+ *  Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 
 package org.onap.policy.models.pdp.concepts;
 
+import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
@@ -35,13 +36,16 @@ import org.onap.policy.models.pdp.enums.PdpState;
  */
 @Getter
 @Setter
-@ToString
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
 public class PdpStateChange extends PdpMessage {
 
-    private String name;
+    /**
+     * System from which the message originated.
+     */
+    private String source;
+
     private PdpState state;
-    private String pdpGroup;
-    private String pdpSubgroup;
 
     /**
      * Constructor for instantiating PdpStateChange class with message name.
@@ -57,11 +61,9 @@ public class PdpStateChange extends PdpMessage {
      * @param source source from which to copy
      */
     public PdpStateChange(PdpStateChange source) {
-        super(PdpMessageType.PDP_STATE_CHANGE);
+        super(source);
 
-        this.name = source.name;
+        this.source = source.source;
         this.state = source.state;
-        this.pdpGroup = source.pdpGroup;
-        this.pdpSubgroup = source.pdpSubgroup;
     }
 }