All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cryptomator.siv.ThreadLocals Maven / Gradle / Ivy

There is a newer version: 1.5.2
Show newest version
package org.cryptomator.siv;

import java.util.function.Supplier;

class ThreadLocals {

	static  ThreadLocal withInitial(Supplier supplier) {
		// ThreadLocal.withInitial is unavailable on Android 7.x
		return new ThreadLocal() {
			@Override
			protected S initialValue() {
				return supplier.get();
			}
		};
	}

}