Handling null

This function helps you handle values which may be null.

Object nullable(Object input)

See Optional.ofNullable() for further details

Returns :

  • The typed value or the String "null" in case the value was null.

Examples :

SpEL without : ${T(java.util.Optional).ofNullable(#mayBeNull).orElse("null")}

SpEL with : ${#nullable(#mayBeNull)}