io.github.dbstarll.utils.json.StatusLineHolder Maven / Gradle / Ivy
The newest version!
package io.github.dbstarll.utils.json;
import org.apache.hc.core5.http.message.StatusLine;
public final class StatusLineHolder {
private static final ThreadLocal HOLDER = new ThreadLocal<>();
private StatusLineHolder() {
// 禁止实例化
}
/**
* 获取StatusLine.
*
* @return StatusLine
*/
public static StatusLine getStatusLine() {
return HOLDER.get();
}
/**
* 设置StatusLine.
*
* @param statusLine StatusLine
*/
public static void setStatusLine(final StatusLine statusLine) {
HOLDER.set(statusLine);
}
/**
* 清除之前设置的StatusLine.
*/
public static void clearStatusLine() {
HOLDER.remove();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy