categories | |
---|---|
|
Currently, The parameter type supports the following construct (from RESTEasy document):
The parameter type you inject into can be any primitive type, a String, or any Java object that has a constructor that takes a String parameter, or a static
valueOf
method that takes a String as a parameter.
This proposal is to support a series of java.util.Optional
types as a wrapper object types. This will give users the ability to use optional typed parameters, and eliminate all null checks by using methods like Optional.orElse()
.
Please note that @PathParam
is an exception for which Optional
is not available. The reason is that Optional
for the @PathParam
use case would just be a NO-OP, since an element of the path cannot be omitted.
-
RESTEasy will offer a mechanism to support a series of
java.util.Optional
types as a wrapper object types. This will give users the ability to use optional typed parameters, and eliminate all null checks by using methods likeOptional.orElse()
. -
Default behavior won’t change.
-
WildFly will allow using the new RESTEasy functionality.