From c9373d8f5809fe650c30832e9409282cb34688f8 Mon Sep 17 00:00:00 2001 From: Gary Wu Date: Sat, 8 Apr 2017 14:36:17 -0700 Subject: Refactor Status to be immutable Change Status class to be immutable. Add convenience method to convert from a LCMCommandStatus to a Status object. Change-Id: I9e47750d15b5ee0f5649b2fabf6387aa12ff9c9d Signed-off-by: Gary Wu --- .../java/org/openecomp/appc/executor/objects/LCMCommandStatus.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'appc-dispatcher/appc-command-executor/appc-command-executor-api/src/main/java') diff --git a/appc-dispatcher/appc-command-executor/appc-command-executor-api/src/main/java/org/openecomp/appc/executor/objects/LCMCommandStatus.java b/appc-dispatcher/appc-command-executor/appc-command-executor-api/src/main/java/org/openecomp/appc/executor/objects/LCMCommandStatus.java index 4e3a40e75..14bd8152c 100644 --- a/appc-dispatcher/appc-command-executor/appc-command-executor-api/src/main/java/org/openecomp/appc/executor/objects/LCMCommandStatus.java +++ b/appc-dispatcher/appc-command-executor/appc-command-executor-api/src/main/java/org/openecomp/appc/executor/objects/LCMCommandStatus.java @@ -23,6 +23,7 @@ package org.openecomp.appc.executor.objects; import org.apache.commons.lang3.StringUtils; +import org.openecomp.appc.domainmodel.lcm.Status; import org.openecomp.appc.util.MessageFormatter; import java.util.Map; @@ -108,5 +109,9 @@ public enum LCMCommandStatus { ", responseMessage='" + responseMessage + '\'' + '}'; } + + public Status toStatus(Params params) { + return new Status(responseCode, getFormattedMessage(params)); + } } -- cgit 1.2.3-korg