default <V> TriFunction<T1, T2, T3, V> andThen(Function<? super R, ? extends V> after) { Objects.requireNonNull(after); return (T1 t1, T2 t2, T3 t3) -> after.apply(apply(t1, t2, t3)); } }
/** * 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); }
/** * <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); }
/** * <p>containsAnyCaseSensitive.</p> * * @return a {@link org.rapidpm.frp.functions.TriFunction} object. */ static TriFunction<String, String[], Boolean, Boolean> containsAnyCaseSensitive() { return (value, needles, caseSensitive) -> Arrays .stream(needles) .anyMatch(needle -> containsCaseSensitive().apply(value, needle, caseSensitive)); }
/** * <p>removeRightCaseSensitive.</p> * * @return a {@link org.rapidpm.frp.functions.TriFunction} object. */ static TriFunction<String, String, Boolean, String> removeRightCaseSensitive() { return (value, suffix, caseSensitive) -> endsWithCaseSensitive().apply(value, suffix, caseSensitive) ? value.substring(0, value.toLowerCase().lastIndexOf(suffix.toLowerCase())) : value; }
/** * 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); }
static BiFunction<Class, String, String> horizontalLayoutID() { return (uiClass , label) -> genericID().apply(uiClass , HorizontalLayout.class , label); } }
static BiFunction<Class, String, String> horizontalLayoutID() { return (uiClass, label) -> genericID().apply(uiClass, HorizontalLayout.class, label); } }
static BiFunction<Class, String, String> horizontalLayoutID() { return (uiClass, label) -> genericID().apply(uiClass, HorizontalLayout.class, label); } }
static BiFunction<Class, String, String> horizontalLayoutID() { return (uiClass, label) -> genericID().apply(uiClass, HorizontalLayout.class, label); } }