[ 
https://issues.apache.org/jira/browse/NLPCRAFT-505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17561739#comment-17561739
 ] 

Sergey Kamov commented on NLPCRAFT-505:
---------------------------------------

List of changes - to confirm

Fix from nullable to optional list:
1.  NCModelConfig.description
2. NCModelConfig.origin

3. def onContext(ctx: NCContext): NCResult = null -> 
   to
   @throws[NCRejection] def onContext(ctx: NCContext): Option[NCResult] = None

4. def onResult(ctx: NCIntentMatch, res: NCResult): NCResult = null 
   to
   def onResult(ctx: NCIntentMatch, res: NCResult): Option[NCResult] = None

5. def onRejection(ctx: NCIntentMatch, e: NCRejection): NCResult = null   
   to
   def onRejection(ctx: Option[NCIntentMatch], e: NCRejection): 
Option[NCResult] = None
   (please also look at https://issues.apache.org/jira/browse/NLPCRAFT-495)

 5. def onError(ctx: NCContext, e: Throwable): NCResult = null
   to
   def onError(ctx: NCContext, e: Throwable): NCResult: Option[NCResult] = None

 

> Nullable arguments for API methods.
> -----------------------------------
>
>                 Key: NLPCRAFT-505
>                 URL: https://issues.apache.org/jira/browse/NLPCRAFT-505
>             Project: NLPCraft
>          Issue Type: Task
>          Components: Main API
>            Reporter: Sergey Kamov
>            Assignee: Sergey Kamov
>            Priority: Major
>             Fix For: 1.0.0
>
>
> Maybe better to have Option instead of nullable arguments of API methods  and 
> functions return type.
> Example: 
>  - org.apache.nlpcraft.NCModel#onRejection(org.apache.nlpcraft.NCIntentMatch 
> - nullable, e: NCRejection): NCResult  - nullable result



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to