mirror of https://github.com/apache/nifi.git
bb9758be2c
Expression Language now supports padding functions: - padLeft: - attr:padLeft(Int n, Char c) will prepend to the `attr` attributes the `c` character until the size `n` is reached - attr:padLeft(Int n) will prepend to the `attr` attributes the `'_'` character until the size `n` is reached - padRight: - attr:padRight(Int n, Char c) will append to the `attr` attributes the `c` character until the size `n` is reached - attr:padRight(Int n) will append to the `attr` attributes the `'_'` character until the size `n` is reached - In both cases, the padding function returns the `attr` `String` as is if its length is already equal of higher than the desired size `n` - Returns null if `attr` does not exist or in case desiredLenght is higher than Integer.MAX_INT Further test cases: - Returns null if the input string is null - Returns a string full of padding if the input string is empty Supports PaddingString instead of PaddingCharacter Apply suggestions from code review Applying style suggestions Co-Authored-By: Marco Gaido <marcogaido91@gmail.com> style fixes style fixes Padding returns input string instead of null in case desired length is missing, is negative, or is overflowing Better tests doc update less verbose parser notation Doc and style fixes Fixed `StringEvaluator.evaluate()` after rebase Applying nitpicking suggestion Co-Authored-By: Marco Gaido <marcogaido91@gmail.com> Fixed `PaddingEvaluator` constructor issue Removed unused import This closes #3615 Signed-off-by: Mike Thomsen <mthomsen@apache.org> |
||
---|---|---|
.. | ||
src/main | ||
LICENSE | ||
NOTICE | ||
pom.xml |