![JAR search and dependency download from the Maven repository](/logo.png)
com.shedhack.thread.threadlocal.utility.ThreadLocalUtility Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of threadlocal-string-utility Show documentation
Show all versions of threadlocal-string-utility Show documentation
ThreadLocal utility that provides static method for (String type) setting, getting and clearing a ThreadLocal..
The newest version!
package com.shedhack.thread.threadlocal.utility;
/**
* Utility class simplifies the manner in which ThreadLocal (of String payload types) are stored, accessed and cleared.
*
* @author imamchishty
*/
public class ThreadLocalUtility {
private static final ThreadLocal local = new ThreadLocal<>();
public static void set(String requestId) {
local.set(requestId);
}
public static String get() {
return local.get();
}
public static void clear(){
local.remove();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy