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

cyclops.conversion.vavr.FromJDK Maven / Gradle / Ivy

The newest version!
package cyclops.conversion.vavr;

import java.util.function.BiFunction;
import java.util.function.Function;



import io.vavr.Function1;
import io.vavr.Function2;
import io.vavr.collection.Stream;
import io.vavr.control.Option;

public class FromJDK {

    public static  Function1 f1(Function fn) {
        return (t) -> fn.apply(t);
    }

    public static  Function2 f2(BiFunction fn) {
        return (t, x) -> fn.apply(t, x);
    }

    public static  Option option(java.util.Optional o) {
        return Option.of(o.orElse(null));
    }

    public static  Stream stream(java.util.stream.Stream stream) {
        return Stream.ofAll(() -> stream.iterator());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy