com.spun.util.ThreadedWrapper Maven / Gradle / Ivy
package com.spun.util;
import java.util.function.Supplier;
public class ThreadedWrapper implements Wrapper
{
private final ThreadLocal instance;
public ThreadedWrapper(Supplier lambda)
{
this.instance = ThreadLocal.withInitial(lambda);
}
@Override
public T get()
{
return instance.get();
}
}