Skip to content

Instantly share code, notes, and snippets.

@timtadh
Created December 5, 2014 19:09
Show Gist options
  • Save timtadh/7e26958faeaf863b82ea to your computer and use it in GitHub Desktop.
Save timtadh/7e26958faeaf863b82ea to your computer and use it in GitHub Desktop.
GSON
package cwru.kxh337.arrowc.il;
import java.util.Map;
import java.util.LinkedHashMap;
import com.google.gson.Gson;
public class IntValue extends Value {
int value = 0;
public IntValue(int value) {
this.value = value;
}
public Map<String,Object> toJson() {
Map<String,Object> M = new LinkedHashMap<String,Object>();
M.put("type", "int-constant");
M.put("value", value);
return M;
}
}
(new Gson()).toJson(value.toJson());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment