/** * <p>curryCheckedBiFunction.</p> * * @param <A> a A object. * @param <B> a B object. * @param <R> a R object. * @return a {@link java.util.function.Function} object. */ static <A, B, R> Function<CheckedBiFunction<A, B, R>, Function<A, CheckedFunction<B, R>>> curryCheckedBiFunction() { return (func) -> a -> b -> func.applyWithException(a, b); }
/** * <p>curryTriFunction.</p> * * @param <A> a A object. * @param <B> a B object. * @param <C> a C object. * @param <R> a R object. * @return a {@link java.util.function.Function} object. */ static <A, B, C, R> Function< TriFunction<A, B, C, R>, Function<A, Function<B, Function<C, R>>>> curryTriFunction() { return (func) -> a -> b -> c -> func.apply(a, b, c); }
default Result<Void> execute() { return apply(null); }
/** * <p>curryCheckedTriFunction.</p> * * @param <A> a A object. * @param <B> a B object. * @param <C> a C object. * @param <R> a R object. * @return a {@link java.util.function.Function} object. */ static <A, B, C, R> Function< CheckedTriFunction<A, B, C, R>, Function<A, Function<B, CheckedFunction<C, R>>>> curryCheckedTriFunction() { return (func) -> a -> b -> c -> func.applyWithException(a, b, c); }
@Override default boolean test(T t) { try { return testWithExceptions(t); } catch (Exception e) { e.printStackTrace(); return false; } }
/** * <p>unCurryCheckedBifunction.</p> * * @param <A> a A object. * @param <B> a B object. * @param <R> a R object. * @return a {@link java.util.function.Function} object. */ static <A, B, R> Function<Function<A, CheckedFunction<B, R>>, CheckedBiFunction<A, B, R>> unCurryCheckedBiFunction() { return (func) -> (a, b) -> func.apply(a).applyWithException(b); }
/** * <p>countSubStr.</p> * * @return a {@link java.util.function.BiFunction} object. */ static BiFunction<String, String, Long> countSubStr() { return (value, subStr) -> countSubStrCaseSensitive().apply(value, subStr, true, false); }
/** * Convert string chars to decimal unicode (5 digits) * <p> * param value The value to encode * * @return Encoded value */ static Function<String, String> decEncode() { return (value) -> encode().apply(value, 5, 10); }
/** * Convert hexadecimal unicode (4 digits) string to string chars * <p> * param value The value to decode * * @return The decoded String */ static Function<String, String> hexDecode() { return (input) -> decode().apply(input, 4, 16); }
/** * Verifies that the needle is contained in the value. The search is case insensitive * <p> * param value to search * param needle to find * * @return true if found else false. */ static BiFunction<String, String, Boolean> contains() { return (value, needle) -> containsCaseSensitive().apply(value, needle, false); }
/** * <p>endsWith.</p> * * @return a {@link java.util.function.BiFunction} object. */ static BiFunction<String, String, Boolean> endsWith() { return (value, search) -> endsWithCaseSensitive().apply(value, search, true); }
/** * Convert binary unicode (16 digits) string to string chars * <p> * param value The value to decode * * @return The decoded String */ static Function<String, String> binDecode() { return (value) -> decode().apply(value, 16, 2); }
/** * Convert decimal unicode (5 digits) string to string chars * <p> * param value The value to decode * * @return decoded String */ static Function<String, String> decDecode() { return (value) -> decode().apply(value, 5, 10); }
/** * Convert string chars to hexadecimal unicode (4 digits) * <p> * param value The value to encode * * @return String in hexadecimal format. */ static Function<String, String> hexEncode() { return (input) -> encode().apply(input, 4, 16); }
/** * <p>ensureLeft.</p> * * @return a {@link java.util.function.BiFunction} object. */ static BiFunction<String, String, String> ensureLeft() { return (input, prefix) -> ensureLeftCaseSensitive().apply(input, prefix, true); }
/** * This method returns the index within the calling String object of the last occurrence of the specified value, searching backwards from the offset. * Returns -1 if the value is not found. The search starts from the end and case sensitive. * <p> * param value The input String * param needle The search String * * @return Return position of the last occurrence of 'needle'. */ static BiFunction<String, String, Integer> lastIndexOf() { return (value, needle) -> lastIndexOfCaseSensitive().apply(value, needle, true); }
/** * <p>removeRight.</p> * * @return a {@link java.util.function.BiFunction} object. */ static BiFunction<String, String, String> removeRight() { return (value, suffix) -> removeRightCaseSensitive().apply(value, suffix, true); }
/** * <p>containsAny.</p> * * @return a {@link java.util.function.BiFunction} object. */ static BiFunction<String, String[], Boolean> containsAny() { return (value, needles) -> containsAnyCaseSensitive().apply(value, needles, false); }
/** * Convert string chars to binary unicode (16 digits) * <p> * param value The value to encode * * @return String in binary format */ static Function<String, String> binEncode() { return (value) -> encode().apply(value, 16, 2); }
/** * Ensures that the value ends with suffix. If it doesn't, it's appended. This operation is case sensitive. * <p> * param value The input String * param suffix The substr to be ensured to be right * * @return The string which is guarenteed to start with substr */ static BiFunction<String, String, String> ensureRight() { return (value, suffix) -> ensureRightCaseSensitive().apply(value, suffix, true); }