Class DialogState
-
- All Implemented Interfaces:
public final class DialogStateThe Dialog state.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDialogState.Companion
-
Field Summary
Fields Modifier and Type Field Description private IntentcurrentIntentprivate final Map<String, EntityStateValue>entityValuesprivate final Map<String, Object>contextprivate UserLocationuserLocationprivate NextUserActionStatenextActionStatepublic final static DialogState.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description DialogState(Intent currentIntent, Map<String, EntityStateValue> entityValues, Map<String, Object> context, UserLocation userLocation, NextUserActionState nextActionState)
-
Method Summary
Modifier and Type Method Description final IntentgetCurrentIntent()The current Intent of the dialog, can be null. final UnitsetCurrentIntent(Intent currentIntent)The current Intent of the dialog, can be null. final Map<String, EntityStateValue>getEntityValues()The current entity values (with their history). final Map<String, Object>getContext()The context of the dialog, a versatile map. final UserLocationgetUserLocation()The current UserLocation if any. final UnitsetUserLocation(UserLocation userLocation)The current UserLocation if any. final NextUserActionStategetNextActionState()The NextUserActionState if any. final UnitsetNextActionState(NextUserActionState nextActionState)The NextUserActionState if any. final UnitsetContextValue(String name, Object value)Updates persistent context value. final UnitsetValue(String role, EntityValue value)Set a new entity value. final UnitsetValue(Entity entity, Value value)Set a new entity value. final UnitchangeValue(Entity entity, Value newValue)Change an entity value. final UnitchangeValue(EntityValue newValue)Change an entity value. final UnitchangeValue(String role, EntityValue newValue)Change an entity value. final UnitresetAllEntityValues()Reset all entity values. final UnitresetValue(String role)Reset the value of an entity. final UnitcleanupState()Same than resetState but remove also entity values history. final UnitresetState()Reset all entity values, context values, userLocation and nextActionState but keep entity values history. final BooleanhasEntity(String role)final BooleanhasEntityPredefinedValue(String role, String value)Does this event contains specified predefined value entity? -
-
Constructor Detail
-
DialogState
DialogState(Intent currentIntent, Map<String, EntityStateValue> entityValues, Map<String, Object> context, UserLocation userLocation, NextUserActionState nextActionState)
-
-
Method Detail
-
getCurrentIntent
final Intent getCurrentIntent()
The current Intent of the dialog, can be null.
-
setCurrentIntent
final Unit setCurrentIntent(Intent currentIntent)
The current Intent of the dialog, can be null.
-
getEntityValues
final Map<String, EntityStateValue> getEntityValues()
The current entity values (with their history).
-
getContext
final Map<String, Object> getContext()
The context of the dialog, a versatile map.
-
getUserLocation
final UserLocation getUserLocation()
The current UserLocation if any.
-
setUserLocation
final Unit setUserLocation(UserLocation userLocation)
The current UserLocation if any.
-
getNextActionState
final NextUserActionState getNextActionState()
The NextUserActionState if any. If not null, it will be applied to the next user action, with NLP custom qualifiers.
-
setNextActionState
final Unit setNextActionState(NextUserActionState nextActionState)
The NextUserActionState if any. If not null, it will be applied to the next user action, with NLP custom qualifiers.
-
setContextValue
final Unit setContextValue(String name, Object value)
Updates persistent context value. Do not store Collection or Map in the context, only plain objects or typed arrays.
-
setValue
final Unit setValue(String role, EntityValue value)
Set a new entity value. Remove previous entity values history.
-
setValue
final Unit setValue(Entity entity, Value value)
Set a new entity value. Remove previous entity values history.
-
changeValue
final Unit changeValue(Entity entity, Value newValue)
Change an entity value. Keep previous entity values history.
-
changeValue
final Unit changeValue(EntityValue newValue)
Change an entity value. Keep previous entity values history.
-
changeValue
final Unit changeValue(String role, EntityValue newValue)
Change an entity value. Keep previous entity values history.
-
resetAllEntityValues
final Unit resetAllEntityValues()
Reset all entity values. Keep entity values history.
-
resetValue
final Unit resetValue(String role)
Reset the value of an entity. Keep entity values history.
-
cleanupState
final Unit cleanupState()
Same than resetState but remove also entity values history.
-
resetState
final Unit resetState()
Reset all entity values, context values, userLocation and nextActionState but keep entity values history.
-
hasEntityPredefinedValue
final Boolean hasEntityPredefinedValue(String role, String value)
Does this event contains specified predefined value entity?
-
-
-
-