Remove Target and TargetType
[policy/models.git] / models-interactions / model-actors / actorServiceProvider / src / main / java / org / onap / policy / controlloop / actorserviceprovider / OperationOutcome.java
index d8db706..2d6a612 100644 (file)
@@ -25,7 +25,6 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.NonNull;
 import org.onap.policy.controlloop.ControlLoopOperation;
-import org.onap.policy.controlloop.policy.PolicyResult;
 
 /**
  * Outcome from an operation. Objects of this type are passed from one stage to the next.
@@ -39,9 +38,10 @@ public class OperationOutcome {
     private Instant start;
     private Instant end;
     private String subRequestId;
-    private PolicyResult result = PolicyResult.SUCCESS;
+    private OperationResult result = OperationResult.SUCCESS;
     private String message;
     private boolean finalOutcome;
+    private Object response;
 
     /**
      * Copy constructor.
@@ -58,6 +58,7 @@ public class OperationOutcome {
         this.result = source.result;
         this.message = source.message;
         this.finalOutcome = source.finalOutcome;
+        this.response = source.response;
     }
 
     /**
@@ -82,6 +83,11 @@ public class OperationOutcome {
         return clo;
     }
 
+    @SuppressWarnings("unchecked")
+    public <T> T getResponse() {
+        return (T) response;
+    }
+
     /**
      * Determines if this outcome is for the given actor and operation.
      *
@@ -112,7 +118,7 @@ public class OperationOutcome {
      *
      * @param result new result
      */
-    public void setResult(@NonNull PolicyResult result) {
+    public void setResult(@NonNull OperationResult result) {
         this.result = result;
     }
 }