mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-05-03 04:19:47 +01:00
Merge pull request #905 from ericbottard/patch-1
* pr/905: Fix elvis operator example
This commit is contained in:
@@ -1113,7 +1113,7 @@ Instead you can use the Elvis operator, named for the resemblance to Elvis' hair
|
|||||||
----
|
----
|
||||||
ExpressionParser parser = new SpelExpressionParser();
|
ExpressionParser parser = new SpelExpressionParser();
|
||||||
|
|
||||||
String name = parser.parseExpression("null?:'Unknown'").getValue(String.class);
|
String name = parser.parseExpression("name?:'Unknown'").getValue(String.class);
|
||||||
|
|
||||||
System.out.println(name); // 'Unknown'
|
System.out.println(name); // 'Unknown'
|
||||||
----
|
----
|
||||||
|
|||||||
Reference in New Issue
Block a user