Modidy a package name of nemo
[nemo.git] / nemo-tools / eclipse-plugin / nemo-rest / org.opendaylight.nemo.tool.eclipse.plugin.rest / src / org / opendaylight / nemo / tool / eclipse / plugin / rest / actions / model / ActionValue.java
1 package org.opendaylight.nemo.tool.eclipse.plugin.rest.actions.model;
2
3 import org.json.JSONArray;
4 import org.json.JSONObject;
5 import org.opendaylight.nemo.tool.eclipse.plugin.rest.actions.UUIDUtils;
6
7 import java.util.List;
8
9 /**
10  * Created by hj on 10/29/15.
11  */
12 public class ActionValue implements INemoItem {
13     private List<String> values;
14
15     public ActionValue(List<String> values) {
16         this.values = values;
17     }
18     public JSONArray getJs(){
19         JSONArray valueArrayJs =new  JSONArray();
20         for (int i=0;i<values.size();i++){
21             String value = values.get(i);
22             JSONObject valueJs = new JSONObject();
23             valueJs.put("value",UUIDUtils.getUUId(value));
24             valueJs.put("order",i+"");
25             valueArrayJs.put(i,valueJs);
26         }
27         return valueArrayJs;
28     }
29     @Override
30     public JSONObject toJSONObject() {
31             //js array,values
32 //        JSONArray valueArrayJs =new  JSONArray();
33 //        for (int i=0;i<values.size();i++){
34 //            String value = values.get(i);
35 //            JSONObject valueJs = new JSONObject();
36 //            valueJs.put("value",value);
37 //            valueJs.put("order",i+"");
38 //            valueArrayJs.put(i,valueJs);
39 //        }
40         return null;
41     }
42 }