Modify pom file
[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 / Action.java
1 package org.opendaylight.nemo.tool.eclipse.plugin.rest.actions.model;
2
3 import org.json.JSONObject;
4
5 /**
6  * Created by hj on 10/29/15.
7  */
8 public class Action implements INemoItem {
9     private String action_name;
10     private ActionValue value;
11
12     public Action(String action_name, ActionValue value) {
13         this.action_name = action_name;
14         this.value = value;
15     }
16
17     @Override
18     public JSONObject toJSONObject() {
19         JSONObject actionJs = new JSONObject();
20         actionJs.put("action-name", action_name);
21         if (value != null){
22                 JSONObject js = new JSONObject();
23             js.put("string-value", value.getJs());
24             actionJs.put("parameter-values", js);
25         }
26         return actionJs;
27     }
28 }