X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=PolicyEngineAPI%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fapi%2FRuleProvider.java;h=24d0bcd2c410f9b216d27030c9bfb3b9b1340254;hb=refs%2Fchanges%2F99%2F64499%2F9;hp=2e45549fcc7430f5ee0d342549478b0efc7afcbb;hpb=2a2ee83914a2d4b2958b33584cf4630b3205b17b;p=policy%2Fengine.git
diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/RuleProvider.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/RuleProvider.java
index 2e45549fc..24d0bcd2c 100644
--- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/RuleProvider.java
+++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/RuleProvider.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* PolicyEngineAPI
* ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,50 +29,56 @@ import com.fasterxml.jackson.annotation.JsonCreator;
* @version 0.1
*/
public enum RuleProvider {
- /**
- * Indicates User will be defining the Rule information.
- */
- CUSTOM("Custom"),
- /**
- * Indicates AAF will be providing the Rule information.
- */
- 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"),
- /**
- * Indicates Guard BLACKLIST YAML
- */
- RAINY_DAY("Rainy_Day")
- ;
-
- private String name;
-
- private RuleProvider(String typeName){
- this.name = typeName;
- }
-
- /**
- * Returns the String
format of Type for this AttributeType
- * @return the String
of the Type for this AttributeType
- */
- @Override
- 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))){
+ /**
+ * Indicates User will be defining the Rule information.
+ */
+ CUSTOM("Custom"),
+ /**
+ * Indicates AAF will be providing the Rule information.
+ */
+ 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"),
+ /**
+ * Indicates Guard BLACKLIST YAML
+ */
+ RAINY_DAY("Rainy_Day"),
+ /**
+ * Indicates Raw
+ */
+ RAW("Raw");
+
+ private final String name;
+
+ private RuleProvider(final String typeName) {
+ this.name = typeName;
+ }
+
+ /**
+ * Returns the String
format of Type for this
+ * AttributeType
+ *
+ * @return the String
of the Type for this
+ * AttributeType
+ */
+ @Override
+ public String toString() {
+ return this.name;
+ }
+
+ @JsonCreator
+ public static RuleProvider create(final String value) {
+ for (final RuleProvider type : values()) {
+ if (type.toString().equalsIgnoreCase(value) || type.name().equalsIgnoreCase(value)) {
return type;
}
}
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Invalid value: " + value);
}
}