Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fixed the Policy API issues and Bugfixes
[policy/engine.git]
/
PolicyEngineAPI
/
src
/
main
/
java
/
org
/
openecomp
/
policy
/
api
/
RuleProvider.java
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
8e92181
..
99f075a
100644
(file)
--- 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;
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}.
/**
* 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.
*/
/**
* 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;
;
private String name;
@@
-50,4
+60,14
@@
public enum RuleProvider {
public String toString() {
return this.name;
}
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();
+ }
}
}