Record Class Conversation
java.lang.Object
java.lang.Record
org.teleight.teleightbots.conversation.Conversation
- Record Components:
name- the name of the conversation, used to identify the conversation. Must be unique.executor- the executor of the conversation, seeConversationExecutorproperties- the properties of the conversationinstanceConstraints- the constraints of the conversation instance, seeConversationInstanceConstraintsallowUnknownProperties- whether unknown properties are allowed. By default, unknown properties are not allowed and will throw an exception.
public record Conversation(String name, ConversationExecutor executor, Map<String,Property<?>> properties, ConversationInstanceConstraints instanceConstraints, boolean allowUnknownProperties)
extends Record
A conversation represents a structured interaction between a bot and a user.
A conversation typically follows a sequence of exchanges (messages) where the bot prompts the user for input, processes the response, and decides on the next step.
A unique name identifies each conversation.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionConversation(String name, ConversationExecutor executor, Map<String, Property<?>> properties, ConversationInstanceConstraints instanceConstraints, boolean allowUnknownProperties) Creates an instance of aConversationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowUnknownPropertiesrecord component.final booleanIndicates whether some other object is "equal to" this one.executor()Returns the value of theexecutorrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinstanceConstraintsrecord component.name()Returns the value of thenamerecord component.static Conversation.BuilderofBuilder(String name, ConversationExecutor executor) Returns the value of thepropertiesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Conversation
public Conversation(String name, ConversationExecutor executor, Map<String, Property<?>> properties, ConversationInstanceConstraints instanceConstraints, boolean allowUnknownProperties) Creates an instance of aConversationrecord class.- Parameters:
name- the value for thenamerecord componentexecutor- the value for theexecutorrecord componentproperties- the value for thepropertiesrecord componentinstanceConstraints- the value for theinstanceConstraintsrecord componentallowUnknownProperties- the value for theallowUnknownPropertiesrecord component
-
-
Method Details
-
ofBuilder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
executor
Returns the value of theexecutorrecord component.- Returns:
- the value of the
executorrecord component
-
properties
Returns the value of thepropertiesrecord component.- Returns:
- the value of the
propertiesrecord component
-
instanceConstraints
Returns the value of theinstanceConstraintsrecord component.- Returns:
- the value of the
instanceConstraintsrecord component
-
allowUnknownProperties
public boolean allowUnknownProperties()Returns the value of theallowUnknownPropertiesrecord component.- Returns:
- the value of the
allowUnknownPropertiesrecord component
-