List of usage examples for java.util.function UnaryOperator andThen
default <V> Function<T, V> andThen(Function<? super R, ? extends V> after)
From source file:com.liferay.dynamic.data.lists.form.web.internal.converter.DDLFormRuleToDDMFormRuleConverter.java
protected String convertOperand(DDLFormRuleCondition.Operand operand) { if (Objects.equals("field", operand.getType())) { return String.format(_functionCallUnaryExpressionFormat, "getValue", StringUtil.quote(operand.getValue())); }/*from w ww .ja v a 2s .com*/ String value = operand.getValue(); if (NumberUtils.isNumber(value)) { return value; } String[] values = StringUtil.split(value); UnaryOperator<String> quoteOperation = StringUtil::quote; UnaryOperator<String> trimOperation = StringUtil::trim; Stream<String> valuesStream = Stream.of(values); Stream<String> valueStream = valuesStream.map(trimOperation.andThen(quoteOperation)); return valueStream.collect(Collectors.joining(StringPool.COMMA_AND_SPACE)); }