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.
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.
this.subRequestId = source.subRequestId;
this.result = source.result;
this.message = source.message;
+ this.finalOutcome = source.finalOutcome;
+ this.response = source.response;
}
/**
* this object. Sets the outcome field to the string representation of this object's
* outcome.
*
- * @return
+ * @return ControlLoopOperation
*/
public ControlLoopOperation toControlLoopOperation() {
ControlLoopOperation clo = new ControlLoopOperation();
return clo;
}
+ @SuppressWarnings("unchecked")
+ public <T> T getResponse() {
+ return (T) response;
+ }
+
/**
* Determines if this outcome is for the given actor and operation.
*
*
* @param result new result
*/
- public void setResult(@NonNull PolicyResult result) {
+ public void setResult(@NonNull OperationResult result) {
this.result = result;
}
}