Policy 1707 commit to LF
[policy/engine.git] / PolicyEngineAPI / src / main / java / org / openecomp / policy / api / RuleProvider.java
index 8e92181..e263d5d 100644 (file)
@@ -20,6 +20,8 @@
 
 package org.openecomp.policy.api;
 
+import com.fasterxml.jackson.annotation.JsonCreator;
+
 /**
  * Enumeration of the Attribute Types that is used as a part of
  * {@link org.openecomp.policy.api.PolicyParameters}.
@@ -50,4 +52,14 @@ public enum RuleProvider {
        public String toString() {
                return this.name;
        }
+       
+       @JsonCreator
+    public static RuleProvider create (String value) {
+        for(RuleProvider type: values()){
+            if(type.toString().equals(value) || type.equals(RuleProvider.valueOf(value))){
+                return type;
+            }
+        }
+        throw new IllegalArgumentException();
+    }
 }