Reduce technical debt and add JUnit
[policy/engine.git] / PolicyEngineAPI / src / main / java / org / onap / policy / api / PolicyParameters.java
index 0d76d8f..cb51e48 100644 (file)
@@ -40,6 +40,7 @@ public class PolicyParameters {
        private String onapName;
        private String configName;
        private Map<AttributeType, Map<String,String>> attributes;
+       private Map<String, String> treatments;
        private String configBody;
        private PolicyType configBodyType;
        private String actionPerformer;
@@ -52,8 +53,8 @@ public class PolicyParameters {
        private String priority;
        private RuleProvider ruleProvider;
        private String controllerName;
-       private ArrayList<String> dependencyNames;
-       private Date TTLDate;
+       private List<String> dependencyNames;
+       private Date ttlDate;
        private boolean guard = false;
        private String riskLevel = "5";
        private String riskType = "default";
@@ -146,6 +147,17 @@ public class PolicyParameters {
        public String getOnapName() {
                return onapName;
        }
+       
+       /**
+     * Gets the ONAP Name value of the Policy Paramters. 
+     * 
+     * @return <code>String</code> format of the ONAP Name
+     * @deprecated Use {@link #getOnapName()} instead. 
+     */
+       @Deprecated
+    public String getEcompName() {
+        return onapName;
+    }
 
        /**
         * Sets the ONAP Name field of the Policy Parameters. 
@@ -155,6 +167,18 @@ public class PolicyParameters {
        public void setOnapName(String onapName) {
                this.onapName = onapName;
        }
+       
+       /**
+     * Sets the ONAP Name field of the Policy Parameters. 
+     * 
+     * @param ecompName the <code>String</code> format of the ONAP Name
+     * @deprecated use {@link #setOnapName(String)} instead. 
+     */
+       @Deprecated
+    public void setEcompName(String ecompName) {
+        this.onapName = ecompName;
+    }
+    
 
        /**
         * Gets the Config Name value of the Policy Parameters. 
@@ -486,10 +510,10 @@ public class PolicyParameters {
        /**
         * Sets the TTLDate field of the Policy Parameters. 
         * 
-        * @param TTLDate the <code>Date</code> format of the TTLDate value
+        * @param ttlDate the <code>Date</code> format of the TTLDate value
         */
-       public void setTtlDate(Date TTLDate){
-               this.TTLDate = TTLDate;
+       public void setTtlDate(Date ttlDate){
+               this.ttlDate = ttlDate;
        }
        
        /**
@@ -498,7 +522,7 @@ public class PolicyParameters {
         * @return the <code>Date</code> value of the TTLDate for Config Policies
         */
        public Date getTtlDate(){
-               return TTLDate;
+               return ttlDate;
        }
        
        /**
@@ -524,7 +548,7 @@ public class PolicyParameters {
      * 
      * @return ArrayList of String(s) format of dependency names.
      */
-    public ArrayList<String> getDependencyNames() {
+    public List<String> getDependencyNames() {
         return dependencyNames;
     }
 
@@ -533,7 +557,7 @@ public class PolicyParameters {
      * 
      * @param dependencyNames ArrayList of String(s). 
      */
-    public void setDependencyNames(ArrayList<String> dependencyNames) {
+    public void setDependencyNames(List<String> dependencyNames) {
         this.dependencyNames = dependencyNames;
     }
        
@@ -545,6 +569,25 @@ public class PolicyParameters {
                this.extendedOption = extendedOption;
        }
        
+       /**
+     * Gets Allowed Treatments Map for Rainy Day Decision Policy
+     * 
+     * @return Map of String format for treatments per errorcode
+     */
+       public Map<String, String> getTreatments() {
+               return treatments;
+       }
+
+       /**
+        * Sets Allowed Treatments Map for Rainy Day Decision Policy 
+        * 
+        * @param treatments Map that contains the treatment per errorcode 
+        */
+       public void setTreatments(Map<String, String> treatments) {
+               this.treatments = treatments;
+       }
+       
+       @Override
        public String toString() {
                return "PolicyParameters [ policyName=" + policyName + ", policyDescription=" + policyDescription + ", onapName="+ onapName 
                                + ", configName=" + configName + ", attributes=" + attributes + ", configBody=" + configBody 
@@ -552,6 +595,6 @@ public class PolicyParameters {
                                + ",dynamicRuleAlgorithmField1=" + dynamicRuleAlgorithmField1 + ",dynamicRuleAlgorithmField2=" + dynamicRuleAlgorithmField2 
                                + ", actionPerformer=" + actionPerformer + ", actionAttribute=" + actionAttribute + ", priority=" + priority  
                                + ", ruleProvider= " + ruleProvider + ", riskLevel= " + riskLevel + ", riskType= " + riskType + ", extendedOption= " + extendedOption
-                               + "]";
+                               + ", treatments= " + treatments + "]";
        }
 }