/* * Copyright 2018-2023 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.lexruntimev2.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* The state of the user's session with Amazon Lex V2. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class SessionState implements Serializable, Cloneable, StructuredPojo { /** ** The next step that Amazon Lex V2 should take in the conversation with a user. *
*/ private DialogAction dialogAction; /** ** The active intent that Amazon Lex V2 is processing. *
*/ private Intent intent; /** ** One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon * Lex V2 considers intents with the matching context as a trigger as the next intent in a session. *
*/ private java.util.List* Map of key/value pairs representing session-specific context information. It contains application information * passed between Amazon Lex V2 and a client application. *
*/ private java.util.Map* A unique identifier for a specific request. *
*/ private String originatingRequestId; /** ** Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help determine the * correct value of a slot. *
*/ private RuntimeHints runtimeHints; /** ** The next step that Amazon Lex V2 should take in the conversation with a user. *
* * @param dialogAction * The next step that Amazon Lex V2 should take in the conversation with a user. */ public void setDialogAction(DialogAction dialogAction) { this.dialogAction = dialogAction; } /** ** The next step that Amazon Lex V2 should take in the conversation with a user. *
* * @return The next step that Amazon Lex V2 should take in the conversation with a user. */ public DialogAction getDialogAction() { return this.dialogAction; } /** ** The next step that Amazon Lex V2 should take in the conversation with a user. *
* * @param dialogAction * The next step that Amazon Lex V2 should take in the conversation with a user. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionState withDialogAction(DialogAction dialogAction) { setDialogAction(dialogAction); return this; } /** ** The active intent that Amazon Lex V2 is processing. *
* * @param intent * The active intent that Amazon Lex V2 is processing. */ public void setIntent(Intent intent) { this.intent = intent; } /** ** The active intent that Amazon Lex V2 is processing. *
* * @return The active intent that Amazon Lex V2 is processing. */ public Intent getIntent() { return this.intent; } /** ** The active intent that Amazon Lex V2 is processing. *
* * @param intent * The active intent that Amazon Lex V2 is processing. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionState withIntent(Intent intent) { setIntent(intent); return this; } /** ** One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon * Lex V2 considers intents with the matching context as a trigger as the next intent in a session. *
* * @return One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, * Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session. */ public java.util.List* One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon * Lex V2 considers intents with the matching context as a trigger as the next intent in a session. *
* * @param activeContexts * One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, * Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session. */ public void setActiveContexts(java.util.Collection* One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon * Lex V2 considers intents with the matching context as a trigger as the next intent in a session. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setActiveContexts(java.util.Collection)} or {@link #withActiveContexts(java.util.Collection)} if you want * to override the existing values. *
* * @param activeContexts * One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, * Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionState withActiveContexts(ActiveContext... activeContexts) { if (this.activeContexts == null) { setActiveContexts(new java.util.ArrayList* One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, Amazon * Lex V2 considers intents with the matching context as a trigger as the next intent in a session. *
* * @param activeContexts * One or more contexts that indicate to Amazon Lex V2 the context of a request. When a context is active, * Amazon Lex V2 considers intents with the matching context as a trigger as the next intent in a session. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionState withActiveContexts(java.util.Collection* Map of key/value pairs representing session-specific context information. It contains application information * passed between Amazon Lex V2 and a client application. *
* * @return Map of key/value pairs representing session-specific context information. It contains application * information passed between Amazon Lex V2 and a client application. */ public java.util.Map* Map of key/value pairs representing session-specific context information. It contains application information * passed between Amazon Lex V2 and a client application. *
* * @param sessionAttributes * Map of key/value pairs representing session-specific context information. It contains application * information passed between Amazon Lex V2 and a client application. */ public void setSessionAttributes(java.util.Map* Map of key/value pairs representing session-specific context information. It contains application information * passed between Amazon Lex V2 and a client application. *
* * @param sessionAttributes * Map of key/value pairs representing session-specific context information. It contains application * information passed between Amazon Lex V2 and a client application. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionState withSessionAttributes(java.util.Map* A unique identifier for a specific request. *
* * @param originatingRequestId * A unique identifier for a specific request. */ public void setOriginatingRequestId(String originatingRequestId) { this.originatingRequestId = originatingRequestId; } /** ** A unique identifier for a specific request. *
* * @return A unique identifier for a specific request. */ public String getOriginatingRequestId() { return this.originatingRequestId; } /** ** A unique identifier for a specific request. *
* * @param originatingRequestId * A unique identifier for a specific request. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionState withOriginatingRequestId(String originatingRequestId) { setOriginatingRequestId(originatingRequestId); return this; } /** ** Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help determine the * correct value of a slot. *
* * @param runtimeHints * Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help * determine the correct value of a slot. */ public void setRuntimeHints(RuntimeHints runtimeHints) { this.runtimeHints = runtimeHints; } /** ** Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help determine the * correct value of a slot. *
* * @return Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help * determine the correct value of a slot. */ public RuntimeHints getRuntimeHints() { return this.runtimeHints; } /** ** Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help determine the * correct value of a slot. *
* * @param runtimeHints * Hints for phrases that a customer is likely to use for a slot. Amazon Lex V2 uses the hints to help * determine the correct value of a slot. * @return Returns a reference to this object so that method calls can be chained together. */ public SessionState withRuntimeHints(RuntimeHints runtimeHints) { setRuntimeHints(runtimeHints); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDialogAction() != null) sb.append("DialogAction: ").append(getDialogAction()).append(","); if (getIntent() != null) sb.append("Intent: ").append(getIntent()).append(","); if (getActiveContexts() != null) sb.append("ActiveContexts: ").append(getActiveContexts()).append(","); if (getSessionAttributes() != null) sb.append("SessionAttributes: ").append(getSessionAttributes()).append(","); if (getOriginatingRequestId() != null) sb.append("OriginatingRequestId: ").append(getOriginatingRequestId()).append(","); if (getRuntimeHints() != null) sb.append("RuntimeHints: ").append(getRuntimeHints()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof SessionState == false) return false; SessionState other = (SessionState) obj; if (other.getDialogAction() == null ^ this.getDialogAction() == null) return false; if (other.getDialogAction() != null && other.getDialogAction().equals(this.getDialogAction()) == false) return false; if (other.getIntent() == null ^ this.getIntent() == null) return false; if (other.getIntent() != null && other.getIntent().equals(this.getIntent()) == false) return false; if (other.getActiveContexts() == null ^ this.getActiveContexts() == null) return false; if (other.getActiveContexts() != null && other.getActiveContexts().equals(this.getActiveContexts()) == false) return false; if (other.getSessionAttributes() == null ^ this.getSessionAttributes() == null) return false; if (other.getSessionAttributes() != null && other.getSessionAttributes().equals(this.getSessionAttributes()) == false) return false; if (other.getOriginatingRequestId() == null ^ this.getOriginatingRequestId() == null) return false; if (other.getOriginatingRequestId() != null && other.getOriginatingRequestId().equals(this.getOriginatingRequestId()) == false) return false; if (other.getRuntimeHints() == null ^ this.getRuntimeHints() == null) return false; if (other.getRuntimeHints() != null && other.getRuntimeHints().equals(this.getRuntimeHints()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDialogAction() == null) ? 0 : getDialogAction().hashCode()); hashCode = prime * hashCode + ((getIntent() == null) ? 0 : getIntent().hashCode()); hashCode = prime * hashCode + ((getActiveContexts() == null) ? 0 : getActiveContexts().hashCode()); hashCode = prime * hashCode + ((getSessionAttributes() == null) ? 0 : getSessionAttributes().hashCode()); hashCode = prime * hashCode + ((getOriginatingRequestId() == null) ? 0 : getOriginatingRequestId().hashCode()); hashCode = prime * hashCode + ((getRuntimeHints() == null) ? 0 : getRuntimeHints().hashCode()); return hashCode; } @Override public SessionState clone() { try { return (SessionState) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.lexruntimev2.model.transform.SessionStateMarshaller.getInstance().marshall(this, protocolMarshaller); } }