Skip to content

Commit

Permalink
by default make unresolved placeholder in scope of applyWithDeletion(…
Browse files Browse the repository at this point in the history
…) return optional instead of the unresolved placeholder

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
  • Loading branch information
thjaeckle committed Nov 14, 2019
1 parent 42b311d commit e03b29e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public static String apply(final String template, final ExpressionResolver expre

/**
* Finds all placeholders ({@code {{ ... }}}) defined in the given {@code template} and tries to replace them
* by applying the given {@code expressionResolver}. If a pipeline function deletes the element, then return
* an empty optional.
* by applying the given {@code expressionResolver}. If a pipeline function deletes the element or the pipeline
* leads to an unresolved element, then return an empty optional.
*
* @param template the template string.
* @param resolver the expression-resolver used to resolve placeholders and optionally pipeline stages
Expand All @@ -147,7 +147,7 @@ public static Optional<String> applyWithDeletion(final String template, final Ex
return resolver.resolve(template, true)
.accept(PipelineElement.<Optional<String>>newVisitorBuilder()
.resolved(Optional::of)
.unresolved(() -> Optional.of(template))
.unresolved(Optional::empty)
.deleted(Optional::empty)
.build());
}
Expand Down

0 comments on commit e03b29e

Please sign in to comment.