aboutsummaryrefslogtreecommitdiffstats
path: root/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java
diff options
context:
space:
mode:
Diffstat (limited to 'restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java')
-rw-r--r--restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java
new file mode 100644
index 0000000..26cbdb5
--- /dev/null
+++ b/restapi-call-node/provider/src/main/java/org/openecomp/sdnc/restapicall/Format.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdnc.restapicall;
+
+public enum Format {
+ JSON, XML;
+
+ public static Format fromString(String s) {
+ if (s == null)
+ return null;
+ if (s.equalsIgnoreCase("json"))
+ return JSON;
+ if (s.equalsIgnoreCase("xml"))
+ return XML;
+ throw new IllegalArgumentException("Invalid value for format: " + s);
+ }
+}