org.fissore.slf4j.Util Maven / Gradle / Ivy
package org.fissore.slf4j;
import java.util.function.Supplier;
public class Util {
private Util() {
}
/**
* Casts a lambda to a Supplier. Best used once statically imported.
*
* import static org.fissore.slf4j.Util.lazy;
*
* ...
*
* logger.error().log("This is a {}", lazy(() -> "test"));
*
*
* @param supplier the lambda to cast
* @return a Supplier
*/
public static Supplier> lazy(Supplier> supplier) {
return supplier;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy