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

ai.timefold.solver.spring.boot.autoconfigure.util.LambdaUtils Maven / Gradle / Ivy

Go to download

Timefold solves planning problems. This lightweight, embeddable planning engine implements powerful and scalable algorithms to optimize business resource scheduling and planning. This module contains the Spring Boot autoconfigure.

The newest version!
package ai.timefold.solver.spring.boot.autoconfigure.util;

import java.util.function.Function;

public class LambdaUtils {

    public static  Function rethrowFunction(ThrowingFunction throwingFunction) {
        return v -> {
            try {
                return throwingFunction.apply(v);
            } catch (Exception ex) {
                throw new RuntimeException(ex);
            }
        };
    }

    @FunctionalInterface
    public interface ThrowingFunction {
        R apply(T t) throws Exception;
    }

    private LambdaUtils() {
        // No external instances.
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy