fix code issues in heat-model 57/57457/1
authorseshukm <seshu.kumar.m@huawei.com>
Wed, 25 Jul 2018 10:09:52 +0000 (18:09 +0800)
committerseshukm <seshu.kumar.m@huawei.com>
Wed, 25 Jul 2018 10:09:52 +0000 (18:09 +0800)
Issue-ID: SO-729

Change-Id: If717d9f9c30cfc924d78cf9b06e3bdd7550fe96b
Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
heat-model/src/main/java/com/woorea/openstack/heat/model/Explanation.java
heat-model/src/main/java/com/woorea/openstack/heat/model/Stack.java
heat-model/src/main/java/com/woorea/openstack/heat/model/UpdateStackParam.java

index 18455e0..ed2395b 100644 (file)
@@ -47,47 +47,47 @@ public class Explanation {
         private String type;
 
         public String getMessage() {
-               return message;
+            return message;
         }
         
         public String getTraceback() {
-               return traceback;
+            return traceback;
         }
         
         public String getType() {
-               return type;
+            return type;
         }
     }
  
     private Error error;
     
     public String getExplanation() {
-       return explanation;
+        return explanation;
     }
     
     public int getCode() {
-       return code;
+        return code;
     }
     
     public String getTitle() {
-       return title;
+        return title;
     }
     
     public Error getError() {
-       return error;
+        return error;
     }
 
-       /* (non-Javadoc)
-        * @see java.lang.Object#toString()
-        */
-       @Override
-       public String toString() {
-               return "Explanation [ " +
-                               "code='" + code +
-                               "', title='" + title +
-                               "', explanation='" + explanation +
-                               "', Error [type='" + error.type +
-                               "', message='" + error.message + "' ] ]";
-       }
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return "Explanation [ " +
+                "code='" + code +
+                "', title='" + title +
+                "', explanation='" + explanation +
+                "', Error [type='" + error.type +
+                "', message='" + error.message + "' ] ]";
+    }
 
 }
index 724f6de..a07764b 100644 (file)
@@ -65,7 +65,7 @@ public class Stack {
     
     // ObjectMapper instance to parse Json stack outputs
     @JsonIgnore
-       private static ObjectMapper mapper = new ObjectMapper();
+    private static ObjectMapper mapper = new ObjectMapper();
 
     public Date getUpdatedTime() {
         return updatedTime;
@@ -133,10 +133,10 @@ public class Stack {
     }
     
     public Map<String, Object> getFiles() {
-       return this.files;
+        return this.files;
     }
     public void setFiles(Map<String, Object> files) {
-       this.files = files;
+        this.files = files;
     }
 
 
@@ -157,103 +157,103 @@ public class Stack {
                 '}';
     }
     
-       @JsonIgnoreProperties(ignoreUnknown=true)
-       public static final class Output {
-           @JsonProperty("output_value")
-               private Object outputValue;
-               
-               private String description;
-               
-           @JsonProperty("output_key")
-               private String outputKey;
-               
-               public Object getOutputValue() {
-                       return outputValue;
-               }
-
-               public String getDescription() {
-                       return description;
-               }
-
-               public String getOutputKey() {
-                       return outputKey;
-               }
-
-               /* (non-Javadoc)
-                * @see java.lang.Object#toString()
-                */
-               @Override
-               public String toString() {
-                       return "Output [key=" + outputKey + ", value="
-                                       + outputValue + "]";
-               }
-       }
-       
-       private List<Output> outputs;
-
-       public List<Output> getOutputs() {
-               return outputs;
-       }
-       
-       private Object _findOutputValue (String key) {
-               for (Output o : outputs) {
-                       if (o.getOutputKey().equals(key)) {
-                               return o.getOutputValue();
-                       }
-               }
-               return null;
-       }
-       
-       /*
-        * Return a stack output as a String.
-        * Generally speaking, most outputs will be Strings.
-        */
-       public String getOutputValue (String key)
-       {
-               Object value = _findOutputValue(key);
-               if (value != null)
-                       return value.toString();
-               else
-                       return null;
-       }
-       
-       /*
-        * Return a stack output as a Json-mapped Object of the provided type.
-        * This is useful for json-object stack outputs.
-        */
-       public <T> T getOutputValue (String key, Class<T> type)
-       {
-               try {
-                       String s = mapper.writeValueAsString(_findOutputValue(key));
-                       return mapper.readValue(s, type);
-               }
-               catch (IOException e) {
-                       return null;
-               }
-       }
-       
-       @JsonProperty("parameters")
-       private Map<String,Object> parameters = new HashMap<>();
-       
-       public void setParameters (Map<String,Object> params)
-       {
-               // Need to "fix" comma-delimited-list parameters for pre-Juno Heat
-               // (see https://bugs.launchpad.net/heat/+bug/1367393)
-               parameters = params;
-               
-               for (Entry<String,Object> param : parameters.entrySet())
-               {
-                       // CDL params are returned as a string with format:
-                       // "[u'<value1>',u'<value2>',...]"
-                       String value = param.getValue().toString();
-                       if (value.startsWith("[") && value.endsWith("]"))
-                       {
-                               param.setValue(value.substring(1,value.length()-1).replaceAll("u'([^\']+)'","$1"));
-                       }
-               }
-       }
-       
-       public Map<String,Object> getParameters() {
-               return parameters;
-       }
+    @JsonIgnoreProperties(ignoreUnknown=true)
+    public static final class Output {
+        @JsonProperty("output_value")
+        private Object outputValue;
+        
+        private String description;
+        
+        @JsonProperty("output_key")
+        private String outputKey;
+        
+        public Object getOutputValue() {
+            return outputValue;
+        }
+
+        public String getDescription() {
+            return description;
+        }
+
+        public String getOutputKey() {
+            return outputKey;
+        }
+
+        /* (non-Javadoc)
+         * @see java.lang.Object#toString()
+         */
+        @Override
+        public String toString() {
+            return "Output [key=" + outputKey + ", value="
+                    + outputValue + "]";
+        }
+    }
+    
+    private List<Output> outputs;
+
+    public List<Output> getOutputs() {
+        return outputs;
+    }
+    
+    private Object _findOutputValue (String key) {
+        for (Output o : outputs) {
+            if (o.getOutputKey().equals(key)) {
+                return o.getOutputValue();
+            }
+        }
+        return null;
+    }
+    
+    /*
+     * Return a stack output as a String.
+     * Generally speaking, most outputs will be Strings.
+     */
+    public String getOutputValue (String key)
+    {
+        Object value = _findOutputValue(key);
+        if (value != null)
+            return value.toString();
+        else
+            return null;
+    }
+    
+    /*
+     * Return a stack output as a Json-mapped Object of the provided type.
+     * This is useful for json-object stack outputs.
+     */
+    public <T> T getOutputValue (String key, Class<T> type)
+    {
+        try {
+            String s = mapper.writeValueAsString(_findOutputValue(key));
+            return mapper.readValue(s, type);
+        }
+        catch (IOException e) {
+            return null;
+        }
+    }
+    
+    @JsonProperty("parameters")
+    private Map<String,Object> parameters = new HashMap<>();
+    
+    public void setParameters (Map<String,Object> params)
+    {
+        // Need to "fix" comma-delimited-list parameters for pre-Juno Heat
+        // (see https://bugs.launchpad.net/heat/+bug/1367393)
+        parameters = params;
+        
+        for (Entry<String,Object> param : parameters.entrySet())
+        {
+            // CDL params are returned as a string with format:
+            // "[u'<value1>',u'<value2>',...]"
+            String value = param.getValue().toString();
+            if (value.startsWith("[") && value.endsWith("]"))
+            {
+                param.setValue(value.substring(1,value.length()-1).replaceAll("u'([^\']+)'","$1"));
+            }
+        }
+    }
+    
+    public Map<String,Object> getParameters() {
+        return parameters;
+    }
 }
index 69041dd..5274d16 100644 (file)
@@ -112,10 +112,10 @@ public class UpdateStackParam {
     }    
 
     public void setFiles(Map<String, Object> files) {
-       this.files = files;
+        this.files = files;
     }
     public Map<String, Object> getFiles() {
-       return this.files;
+        return this.files;
     }
 
     /**