[ 
http://issues.ops4j.org/browse/QI-144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Niclas Hedhman reopened QI-144:
-------------------------------


> Implement @Optional for method parameters
> -----------------------------------------
>
>                 Key: QI-144
>                 URL: http://issues.ops4j.org/browse/QI-144
>             Project: Qi4j
>          Issue Type: New Feature
>            Reporter: Rickard Öberg
>            Assignee: Rickard Öberg
>
> Currently the best way to declare that a method parameter cannot be null is 
> to use the @NotNull constraint. It has been argued that this should be the 
> default case, and instead one would have to set @Optional if it is not 
> necessary. Instead of:
> void doStuff(String optional, @NotNull String mandatory);
> one would do:
> void doStuff(@Optional String optional, String mandatory);
> If the value is optional, then a null value would imply that there is no need 
> to call the constraints of that parameter. Implementing this in the framework 
> would simplify constraints as they would then know that if they are invoked 
> the value would be non-null.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.ops4j.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to