
uk.co.mruoc.string.StringFunctionComposer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of string-utils Show documentation
Show all versions of string-utils Show documentation
Library containing string utilites
The newest version!
package uk.co.mruoc.string;
import java.util.Arrays;
import java.util.Collection;
import java.util.function.Function;
import java.util.function.UnaryOperator;
import java.util.stream.Stream;
public interface StringFunctionComposer {
@SafeVarargs
static UnaryOperator compose(Function... functions) {
return compose(Arrays.asList(functions));
}
static UnaryOperator compose(Collection> functions) {
return compose(functions.stream());
}
static UnaryOperator compose(Stream> functions) {
return functions.reduce(Function.identity(), Function::compose)::apply;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy