diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2020-02-21 14:57:50 -0500 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2020-03-01 17:56:45 -0500 |
commit | d0ba41b23a788bc557f451a0c66f0095c10dd390 (patch) | |
tree | 518c77533c5f852345e12bb661697e064a9dbe35 /models-interactions/model-impl | |
parent | 76a2d0ed90c281768793a279debbd6ee6e445fce (diff) |
Add SDNR Actor
Actor for SDNR and necessary JUnit tests.
Removed the Pair code.
Issue-ID: POLICY-2382
Change-Id: I3da1d95f431cc076f12e9ad26280b92058fe51cc
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'models-interactions/model-impl')
-rw-r--r-- | models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/StatusCodeEnum.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/StatusCodeEnum.java b/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/StatusCodeEnum.java index 483062d6f..09c62c23c 100644 --- a/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/StatusCodeEnum.java +++ b/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/StatusCodeEnum.java @@ -74,6 +74,42 @@ public enum StatusCodeEnum { return null; } + /** + * Best guess on a value, but since some of these + * codes could be any value this may be difficult to + * use during runtime. + + * @param code input StatusCodeEnum + * @return integer value + */ + public static int toValue(StatusCodeEnum code) { + switch (code) { + case ACCEPTED: + return 100; + + case SUCCESS: + return 200; + + case REJECT: + return 300; + + case ERROR: + return 400; + + case FAILURE: + return 450; + + case PARTIAL_SUCCESS: + return 500; + + case PARTIAL_FAILURE: + return 501; + + default: + return 0; + } + } + private static boolean isRejectStatusCode(final int statusCode) { return statusCode >= 300 && statusCode <= 313; } |