Class Util


  • public class Util
    extends Object
    • Method Detail

      • lazy

        public static Supplier<?> lazy​(Supplier<?> supplier)
        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"));
         
        Parameters:
        supplier - the lambda to cast
        Returns:
        a Supplier