class VariablesAPI extends API {

    private static final Logger LOG = Log.logger(VariablesAPI.class);

    @PUT
    @Timed
    @Path("{key}")
    @Consumes(APPLICATION_JSON)
    @Produces(APPLICATION_JSON_WITH_CHARSET)
    public Map<String, Object> update(@Context GraphManager manager,
                                      @PathParam("graph") String graph,
                                      @PathParam("key") String key,
                                      JsonVariableValue value) {
        E.checkArgument(value != null && value.data != null,
                        "The variable value can't be empty");
        LOG.debug("Graph [{}] set variable for {}: {}", graph, key, value);

        HugeGraph g = graph(manager, graph);
        commit(g, () -> g.variables().set(key, value.data));
        return ImmutableMap.of(key, value.data);
    }

    @GET
    @Timed
    @Produces(APPLICATION_JSON_WITH_CHARSET)
    public Map<String, Object> list(@Context GraphManager manager,
                                    @PathParam("graph") String graph) {
        LOG.debug("Graph [{}] get variables", graph);

        HugeGraph g = graph(manager, graph);
        return g.variables().asMap();
    }

    @GET
    @Timed
    @Path("{key}")
    @Produces(APPLICATION_JSON_WITH_CHARSET)
    public Map<String, Object> get(@Context GraphManager manager,
                                   @PathParam("graph") String graph,
                                   @PathParam("key") String key) {<FILL_FUNCTION_BODY>}

    @DELETE
    @Timed
    @Path("{key}")
    @Consumes(APPLICATION_JSON)
    public void delete(@Context GraphManager manager,
                       @PathParam("graph") String graph,
                       @PathParam("key") String key) {
        LOG.debug("Graph [{}] remove variable by key '{}'", graph, key);

        HugeGraph g = graph(manager, graph);
        commit(g, () -> g.variables().remove(key));
    }

    private static class JsonVariableValue {

        public Object data;

        @Override
        public String toString() {
            return String.format("JsonVariableValue{data=%s}", this.data);
        }
    }
}

        LOG.debug("Graph [{}] get variable by key '{}'", graph, key);

        HugeGraph g = graph(manager, graph);
        Optional<?> object = g.variables().get(key);
        if (!object.isPresent()) {
            throw new NotFoundException(String.format(
                    "Variable '%s' does not exist", key));
        }
        return ImmutableMap.of(key, object.get());
    
<methods>public non-sealed void <init>() ,public static boolean checkAndParseAction(java.lang.String) ,public static R commit(org.apache.hugegraph.HugeGraph, Callable<R>) ,public static void commit(org.apache.hugegraph.HugeGraph, java.lang.Runnable) ,public static org.apache.hugegraph.HugeGraph graph(org.apache.hugegraph.core.GraphManager, java.lang.String) ,public static org.apache.hugegraph.HugeGraph graph4admin(org.apache.hugegraph.core.GraphManager, java.lang.String) ,public static java.lang.Object[] properties(Map<java.lang.String,java.lang.Object>) <variables>public static final java.lang.String ACTION_APPEND,public static final java.lang.String ACTION_CLEAR,public static final java.lang.String ACTION_ELIMINATE,public static final java.lang.String APPLICATION_JSON,public static final java.lang.String APPLICATION_JSON_WITH_CHARSET,public static final java.lang.String APPLICATION_TEXT_WITH_CHARSET,public static final java.lang.String CHARSET,private static final Meter EXPECTED_ERROR_METER,private static final Meter ILLEGAL_ARG_ERROR_METER,public static final java.lang.String JSON,protected static final Logger LOG,private static final Meter SUCCEED_METER,public static final java.lang.String TEXT_PLAIN,private static final Meter UNKNOWN_ERROR_METER