All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.luyiisme.script.groovy.DefaultInvokeContext Maven / Gradle / Ivy

There is a newer version: 0.3.0
Show newest version
package io.github.luyiisme.script.groovy;

import io.github.luyiisme.script.api.InvokeContext;

import java.util.Map;

/**
 * Created by luyi on 16/5/16.
 */
public class DefaultInvokeContext implements InvokeContext {
    private static final ThreadLocal> PARAMS = new ThreadLocal>();

    @Override
    public  T get(String key) {
        Map map = PARAMS.get();
        if (map != null) {
            return (T) map.get(key);
        }
        return null;
    }

    public void setParams(Map params) {
        PARAMS.set(params);
    }

    public void clear() {
        PARAMS.set(null);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy