X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=PolicyEngineAPI%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fapi%2FDictionaryType.java;h=56b73221ff9450855ca8b2eafebd33831325ccd9;hb=5450bdbfb94fb5217617da6c41971fd26f7e81b5;hp=499295d65dc00898d918f0cbca8ef3113d874d8d;hpb=a9710cb3b80c73c98d257c676ba6ecf9e30ef758;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 499295d65..56b73221f 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java @@ -22,80 +22,82 @@ 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 - */ - @Override - 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 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); } }