public class ActiveContext
extends java.lang.Object
implements java.io.Serializable
A context is a variable that contains information about the current state of
the conversation between a user and Amazon Lex. Context can be set
automatically by Amazon Lex when an intent is fulfilled, or it can be set at
runtime using the PutContent
, PutText
, or
PutSession
operation.
Constructor and Description |
---|
ActiveContext() |
Modifier and Type | Method and Description |
---|---|
ActiveContext |
addparametersEntry(java.lang.String key,
java.lang.String value)
State variables for the current context.
|
ActiveContext |
clearparametersEntries()
Removes all the entries added into parameters.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getName()
The name of the context.
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters()
State variables for the current context.
|
ActiveContextTimeToLive |
getTimeToLive()
The length of time or number of turns that a context remains active.
|
int |
hashCode() |
void |
setName(java.lang.String name)
The name of the context.
|
void |
setParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
State variables for the current context.
|
void |
setTimeToLive(ActiveContextTimeToLive timeToLive)
The length of time or number of turns that a context remains active.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
ActiveContext |
withName(java.lang.String name)
The name of the context.
|
ActiveContext |
withParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
State variables for the current context.
|
ActiveContext |
withTimeToLive(ActiveContextTimeToLive timeToLive)
The length of time or number of turns that a context remains active.
|
public java.lang.String getName()
The name of the context.
Constraints:
Length: 1 - 100
Pattern: ^([A-Za-z]_?)+$
The name of the context.
public void setName(java.lang.String name)
The name of the context.
Constraints:
Length: 1 - 100
Pattern: ^([A-Za-z]_?)+$
name
- The name of the context.
public ActiveContext withName(java.lang.String name)
The name of the context.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 100
Pattern: ^([A-Za-z]_?)+$
name
- The name of the context.
public ActiveContextTimeToLive getTimeToLive()
The length of time or number of turns that a context remains active.
The length of time or number of turns that a context remains active.
public void setTimeToLive(ActiveContextTimeToLive timeToLive)
The length of time or number of turns that a context remains active.
timeToLive
- The length of time or number of turns that a context remains active.
public ActiveContext withTimeToLive(ActiveContextTimeToLive timeToLive)
The length of time or number of turns that a context remains active.
Returns a reference to this object so that method calls can be chained together.
timeToLive
- The length of time or number of turns that a context remains active.
public java.util.Map<java.lang.String,java.lang.String> getParameters()
State variables for the current context. You can use these values as default values for slots in subsequent events.
State variables for the current context. You can use these values as default values for slots in subsequent events.
public void setParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
State variables for the current context. You can use these values as default values for slots in subsequent events.
parameters
- State variables for the current context. You can use these values as default values for slots in subsequent events.
public ActiveContext withParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
State variables for the current context. You can use these values as default values for slots in subsequent events.
Returns a reference to this object so that method calls can be chained together.
parameters
- State variables for the current context. You can use these values as default values for slots in subsequent events.
public ActiveContext addparametersEntry(java.lang.String key, java.lang.String value)
State variables for the current context. You can use these values as default values for slots in subsequent events.
The method adds a new key-value pair into parameters parameter, and returns a reference to this object so that method calls can be chained together.
key
- The key of the entry to be added into parameters.value
- The corresponding value of the entry to be added into
parameters.public ActiveContext clearparametersEntries()
Returns a reference to this object so that method calls can be chained together.
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object