X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=PolicyEngineAPI%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fapi%2FRuleProvider.java;h=99f075a302dfad3984d64b5f0ceaa738b1fed153;hb=fc5c07705edc4dcb7083b39116a43844bb6a1490;hp=8e921812474b82d36bb4ae4aae2e24433fbd5e86;hpb=91d04c64771832a0b8815ffbe1f0f9920320d94d;p=policy%2Fengine.git diff --git a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/RuleProvider.java b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/RuleProvider.java index 8e9218124..99f075a30 100644 --- a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/RuleProvider.java +++ b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/RuleProvider.java @@ -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(); + } }