com.github.houbbbbb.sso.util.ThreadLocalUtil Maven / Gradle / Ivy
The newest version!
package com.github.houbbbbb.sso.util;
/**
* @author: hbw
* @date: 2020/7/31
**/
public class ThreadLocalUtil {
private ThreadLocalUtil() {}
private static final ThreadLocal TL = new ThreadLocal<>();
public static void set (String value) {
TL.set(value);
}
public static String get () {
String value = TL.get();
if (null != value) {
TL.remove();
}
return value;
}
}