X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=PolicyEngineAPI%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fapi%2FDictionaryType.java;h=e0f0264e202a5442a1e46ab82f9b05a299d24b15;hb=b6d9063e06ab8cdf2d97fc75810792659344e4a8;hp=5ac6d5ed8875373f355a0656efab9eeb3571cb81;hpb=073cc188efe9abb4c010cf674e34e2cf46ef1c52;p=policy%2Fengine.git
diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java
index 5ac6d5ed8..e0f0264e2 100644
--- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java
+++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java
@@ -22,79 +22,86 @@ package org.onap.policy.api;
import com.fasterxml.jackson.annotation.JsonCreator;
-public enum DictionaryType{
- /**
- * Indicates Common Dictionaries.
- */
- Common("Common"),
- /**
- * Indicates Action Policy Dictionaries
- */
- Action("Action"),
- /**
- * Indicates ClosedLoop Policy Dictionaries.
- */
- ClosedLoop("ClosedLoop"),
- /**
- * Indicates Firewall Config Policy Dictionaries.
- */
- Firewall("Firewall"),
- /**
- * Indicates Decision Policy Dictionaries.
- */
- Decision("Decision"),
- /**
- * Indicates BRMS Policy Dictionaries.
- */
- BRMS("BRMS"),
- /**
- * Indicates DCAE Micro Service Policy Dictionaries.
- */
- MicroService("MicroService"),
- /**
- * Indicates Descriptive Scope Dictionaries
- */
- DescriptiveScope("DescriptiveScope"),
- /**
- * Indicates Policy Scope Dictionaries
- */
- PolicyScope("PolicyScope"),
- /**
- * Indicates Enforcer Dictionaries
- */
- Enforcer("Enforcer"),
- /**
- * Indicates SafePolicy Dictionaries
- */
- SafePolicy("SafePolicy"),
- /**
- * Enum support entry to extend dictionary
- */
- Extended("Extended"),
- ;
-
- private String name;
-
- private DictionaryType(String typeName){
- this.name = typeName;
- }
-
- /**
- * Returns the String
format of Type for this PolicyClass
- * @return the String
of the Type for this PolicyClass
- */
- public String toString() {
- return this.name;
- }
-
- @JsonCreator
- public static DictionaryType create (String value) {
- for(DictionaryType type: values()){
- if(type.toString().equals(value) || type.equals(DictionaryType.valueOf(value))){
+public enum DictionaryType {
+ /**
+ * Indicates Common Dictionaries.
+ */
+ Common("Common"),
+ /**
+ * Indicates Action Policy Dictionaries
+ */
+ Action("Action"),
+ /**
+ * Indicates ClosedLoop Policy Dictionaries.
+ */
+ ClosedLoop("ClosedLoop"),
+ /**
+ * Indicates Firewall Config Policy Dictionaries.
+ */
+ Firewall("Firewall"),
+ /**
+ * Indicates Decision Policy Dictionaries.
+ */
+ Decision("Decision"),
+ /**
+ * Indicates BRMS Policy Dictionaries.
+ */
+ BRMS("BRMS"),
+ /**
+ * Indicates DCAE Micro Service Policy Dictionaries.
+ */
+ MicroService("MicroService"),
+ /**
+ * Indicates Optimization Policy Dictionaries
+ */
+ Optimization("Optimization"),
+ /**
+ * Indicates Descriptive Scope Dictionaries
+ */
+ DescriptiveScope("DescriptiveScope"),
+ /**
+ * Indicates Policy Scope Dictionaries
+ */
+ PolicyScope("PolicyScope"),
+ /**
+ * Indicates Enforcer Dictionaries
+ */
+ Enforcer("Enforcer"),
+ /**
+ * Indicates SafePolicy Dictionaries
+ */
+ SafePolicy("SafePolicy"),
+ /**
+ * Enum support entry to extend dictionary
+ */
+ Extended("Extended");
+
+ private final String name;
+
+ private DictionaryType(final String typeName) {
+ this.name = typeName;
+ }
+
+ /**
+ * Returns the String
format of Type for this
+ * PolicyClass
+ *
+ * @return the String
of the Type for this
+ * PolicyClass
+ */
+ @Override
+ public String toString() {
+ return this.name;
+ }
+
+ @JsonCreator
+ public static DictionaryType create(final String value) {
+ for (final DictionaryType type : values()) {
+ if (type.toString().equalsIgnoreCase(value) || type.name().equalsIgnoreCase(value)) {
return type;
}
}
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Invalid value: " + value);
}
}