Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Map;

public class Main {
    private static ThreadLocal<Map> params = new ThreadLocal<Map>();

    /**
     * getting value from current ThreadLocal map.
     * @param name
     * @return
     * @author <a href="mailto:iffiff1@gmail.com">Tyler Chen</a> 
     * @since Aug 18, 2015
     */
    public static <T> T get(String name) {
        Map map = params.get();
        if (map == null) {
            return null;
        }
        return (T) map.get(name);
    }
}