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
Policy 1707 commit to LF
[policy/engine.git]
/
PolicyEngineAPI
/
src
/
main
/
java
/
org
/
openecomp
/
policy
/
api
/
PolicyClass.java
diff --git
a/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyClass.java
b/PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyClass.java
index
caf3c11
..
8b87f40
100644
(file)
--- a/
PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyClass.java
+++ b/
PolicyEngineAPI/src/main/java/org/openecomp/policy/api/PolicyClass.java
@@
-20,6
+20,8
@@
package org.openecomp.policy.api;
package org.openecomp.policy.api;
+import com.fasterxml.jackson.annotation.JsonCreator;
+
/**
* Enumeration of the Policy Types that is used as a part of
* {@link org.openecomp.policy.api.PolicyParameters}.
/**
* Enumeration of the Policy Types that is used as a part of
* {@link org.openecomp.policy.api.PolicyParameters}.
@@
-53,4
+55,13
@@
public enum PolicyClass {
public String toString() {
return this.name;
}
public String toString() {
return this.name;
}
+ @JsonCreator
+ public static PolicyClass create (String value) {
+ for(PolicyClass type: values()){
+ if(type.toString().equals(value) || type.equals(PolicyClass.valueOf(value))){
+ return type;
+ }
+ }
+ throw new IllegalArgumentException();
+ }
}
}