You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2021/05/16 23:04:43 UTC
[incubator-nlpcraft] branch master updated: Update NCResult.java
This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/master by this push:
new cb4369b Update NCResult.java
cb4369b is described below
commit cb4369b575bd280757ba32608b90436301c02dc6
Author: unknown <ar...@datalingvo.com>
AuthorDate: Sun May 16 16:04:32 2021 -0700
Update NCResult.java
---
.../src/main/scala/org/apache/nlpcraft/model/NCResult.java | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCResult.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCResult.java
index 67b9e99..1f89e43 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCResult.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCResult.java
@@ -19,11 +19,10 @@ package org.apache.nlpcraft.model;
import org.apache.nlpcraft.common.NCException;
import org.apache.nlpcraft.common.util.*;
+import org.apache.nlpcraft.model.impl.NCMetadataAdapter;
import java.io.Serializable;
import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
/**
* Data model result returned from model intent callbacks. Result consists of the
@@ -56,7 +55,7 @@ import java.util.Map;
* accordingly. For example, the REST client interfacing between NLPCraft and Amazon Alexa or Apple HomeKit can only
* accept {@code text} result type and ignore everything else.
*/
-public class NCResult implements Serializable, NCMetadata {
+public class NCResult extends NCMetadataAdapter implements Serializable, NCMetadata {
/** Data Model result text. */
private String body;
@@ -69,9 +68,6 @@ public class NCResult implements Serializable, NCMetadata {
/** ID of the intent. */
private String intentId;
- /** Result's metadata. */
- private final Map<String, Object> meta = new HashMap<>();
-
/**
* Creates new result with given body and type.
*
@@ -244,6 +240,4 @@ public class NCResult implements Serializable, NCMetadata {
public void setIntentId(String intentId) {
this.intentId = intentId;
}
-
- @Override public Map<String, Object> getMetadata() { return meta; }
}