/* * Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.lexrts.model; import java.io.Serializable; /** *
* An intent that Amazon Lex suggests satisfies the user's intent. Includes the * name of the intent, the confidence that Amazon Lex has that the user's intent * is satisfied, and the slots defined for the intent. *
*/ public class PredictedIntent implements Serializable { /** ** The name of the intent that Amazon Lex suggests satisfies the user's * intent. *
*/ private String intentName; /** ** Indicates how confident Amazon Lex is that an intent satisfies the user's * intent. *
*/ private IntentConfidence nluIntentConfidence; /** ** The slot and slot values associated with the predicted intent. *
*/ private java.util.Map* The name of the intent that Amazon Lex suggests satisfies the user's * intent. *
* * @return* The name of the intent that Amazon Lex suggests satisfies the * user's intent. *
*/ public String getIntentName() { return intentName; } /** ** The name of the intent that Amazon Lex suggests satisfies the user's * intent. *
* * @param intentName* The name of the intent that Amazon Lex suggests satisfies the * user's intent. *
*/ public void setIntentName(String intentName) { this.intentName = intentName; } /** ** The name of the intent that Amazon Lex suggests satisfies the user's * intent. *
** Returns a reference to this object so that method calls can be chained * together. * * @param intentName
* The name of the intent that Amazon Lex suggests satisfies the * user's intent. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PredictedIntent withIntentName(String intentName) { this.intentName = intentName; return this; } /** ** Indicates how confident Amazon Lex is that an intent satisfies the user's * intent. *
* * @return* Indicates how confident Amazon Lex is that an intent satisfies * the user's intent. *
*/ public IntentConfidence getNluIntentConfidence() { return nluIntentConfidence; } /** ** Indicates how confident Amazon Lex is that an intent satisfies the user's * intent. *
* * @param nluIntentConfidence* Indicates how confident Amazon Lex is that an intent satisfies * the user's intent. *
*/ public void setNluIntentConfidence(IntentConfidence nluIntentConfidence) { this.nluIntentConfidence = nluIntentConfidence; } /** ** Indicates how confident Amazon Lex is that an intent satisfies the user's * intent. *
** Returns a reference to this object so that method calls can be chained * together. * * @param nluIntentConfidence
* Indicates how confident Amazon Lex is that an intent satisfies * the user's intent. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PredictedIntent withNluIntentConfidence(IntentConfidence nluIntentConfidence) { this.nluIntentConfidence = nluIntentConfidence; return this; } /** ** The slot and slot values associated with the predicted intent. *
* * @return* The slot and slot values associated with the predicted intent. *
*/ public java.util.Map* The slot and slot values associated with the predicted intent. *
* * @param slots* The slot and slot values associated with the predicted intent. *
*/ public void setSlots(java.util.Map* The slot and slot values associated with the predicted intent. *
** Returns a reference to this object so that method calls can be chained * together. * * @param slots
* The slot and slot values associated with the predicted intent. *
* @return A reference to this updated object so that method calls can be * chained together. */ public PredictedIntent withSlots(java.util.Map* The slot and slot values associated with the predicted intent. *
*
* The method adds a new key-value pair into slots parameter, and returns a
* reference to this object so that method calls can be chained together.
*
* @param key The key of the entry to be added into slots.
* @param value The corresponding value of the entry to be added into slots.
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public PredictedIntent addslotsEntry(String key, String value) {
if (null == this.slots) {
this.slots = new java.util.HashMap
* Returns a reference to this object so that method calls can be chained
* together.
*/
public PredictedIntent clearslotsEntries() {
this.slots = null;
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getIntentName() != null)
sb.append("intentName: " + getIntentName() + ",");
if (getNluIntentConfidence() != null)
sb.append("nluIntentConfidence: " + getNluIntentConfidence() + ",");
if (getSlots() != null)
sb.append("slots: " + getSlots());
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getIntentName() == null) ? 0 : getIntentName().hashCode());
hashCode = prime * hashCode
+ ((getNluIntentConfidence() == null) ? 0 : getNluIntentConfidence().hashCode());
hashCode = prime * hashCode + ((getSlots() == null) ? 0 : getSlots().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PredictedIntent == false)
return false;
PredictedIntent other = (PredictedIntent) obj;
if (other.getIntentName() == null ^ this.getIntentName() == null)
return false;
if (other.getIntentName() != null
&& other.getIntentName().equals(this.getIntentName()) == false)
return false;
if (other.getNluIntentConfidence() == null ^ this.getNluIntentConfidence() == null)
return false;
if (other.getNluIntentConfidence() != null
&& other.getNluIntentConfidence().equals(this.getNluIntentConfidence()) == false)
return false;
if (other.getSlots() == null ^ this.getSlots() == null)
return false;
if (other.getSlots() != null && other.getSlots().equals(this.getSlots()) == false)
return false;
return true;
}
}