Fixed the Policy API issues and Bugfixes
[policy/engine.git] / PolicyEngineAPI / src / main / java / org / openecomp / policy / api / RuleProvider.java
index 8e92181..99f075a 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}.
@@ -34,7 +36,15 @@ public enum RuleProvider {
        /**
         * Indicates AAF will be providing the Rule information. 
         */
-       AAF("AAF")
+       AAF("AAF"),
+       /**
+        * Indicates Guard YAML will be providing the Rule information.
+        */
+       GUARD_YAML("GUARD_YAML"),
+       /**
+        * Indicates Guard BLACKLIST YAML 
+        */
+       GUARD_BL_YAML("GUARD_BL_YAML")
        ;
        
        private String name;
@@ -50,4 +60,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();
+    }
 }