Skip to content

Commit

Permalink
Merge pull request #877 from mP1/feature/ExpressionEvaluationContext-…
Browse files Browse the repository at this point in the history
…REFERENCE_NOT_FOUND_VALUE-N-REFERENCE_NULL_VALUE-constants

ExpressionEvaluationContext.REFERENCE_NOT_FOUND_VALUE &  REFERENCE_NU…
  • Loading branch information
mP1 authored Feb 5, 2025
2 parents 5f2b2f6 + 3f4eb0f commit ef1d39d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,18 @@ Object evaluateFunction(final ExpressionFunction<?, ? extends ExpressionEvaluati
*/
Object handleException(final RuntimeException exception);

/**
* A constant holding the value for a reference that was not found.
*/
Optional<Optional<Object>> REFERENCE_NOT_FOUND_VALUE = Optional.empty();

/**
* A constant holding the value for a reference that has a null value.
*/
Optional<Optional<Object>> REFERENCE_NULL_VALUE = Optional.of(
Optional.empty()
);

/**
* Locates the value or a {@link Expression} for the given {@link ExpressionReference}.
* <pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,18 @@ public void testPrepareParameters() {
);
}

// reference........................................................................................................

@Test
public void testReferenceNotFoundValueDifferentReferenceNullValue() {
this.checkNotEquals(
ExpressionEvaluationContext.REFERENCE_NOT_FOUND_VALUE,
ExpressionEvaluationContext.REFERENCE_NULL_VALUE
);
}

// class............................................................................................................

@Override
public Class<ExpressionEvaluationContext> type() {
return ExpressionEvaluationContext.class;
Expand Down

0 comments on commit ef1d39d

Please sign in to comment.