com.github.phantomthief.scope.SubstituteThreadLocal Maven / Gradle / Ivy
package com.github.phantomthief.scope;
import javax.annotation.Nonnull;
/**
* @author w.vela
* Created on 2019-07-09.
*/
class SubstituteThreadLocal implements MyThreadLocal {
private MyThreadLocal realThreadLocal;
SubstituteThreadLocal(@Nonnull MyThreadLocal realThreadLocal) {
this.realThreadLocal = realThreadLocal;
}
@Nonnull
MyThreadLocal getRealThreadLocal() {
return realThreadLocal;
}
void setRealThreadLocal(@Nonnull MyThreadLocal realThreadLocal) {
this.realThreadLocal = realThreadLocal;
}
@Override
public T get() {
return realThreadLocal.get();
}
@Override
public void set(T value) {
realThreadLocal.set(value);
}
@Override
public void remove() {
realThreadLocal.remove();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy