package com.changfa.constants;

public class ThreadContext {
    private Object object;
    private  static ThreadLocal<Object> t = new ThreadLocal<>();
    private static ThreadContext threadContext;

    public static ThreadContext getInstance(){
        if(threadContext == null){
            threadContext = new ThreadContext();
        }
        return threadContext;
    }
    public ThreadContext(){

    }



    public  void set(Object o){
        t.set(o);
    }

    public  Object get(){
       return t.get();
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }
}
