Package com.chatmotorapi.api
Class MotorUserMessage
java.lang.Object
com.chatmotorapi.api.MotorUserMessage
- All Implemented Interfaces:
MotorMessage
public class MotorUserMessage extends Object implements MotorMessage
Represents a user-generated message within the ChatMotor system, specifically
designed to store user prompts. This class encapsulates messages that
originate from users, capturing their input as prompts for the system to
respond to or process. These prompts typically guide the conversation or
interaction within the ChatMotor.
It implements the MotorMessage
interface, ensuring it can be
seamlessly integrated and managed within the ChatMotor's broader messaging
framework.
-
Constructor Summary
Constructors Constructor Description MotorUserMessage(String message)
Constructs a new MotorUserMessage with a specified user prompt. -
Method Summary
Modifier and Type Method Description boolean
equals(Object obj)
Compares this MotorUserMessage to the specified object to determine equality.String
getContent()
Retrieves the text of the user prompt stored in this message.int
hashCode()
Computes the hash code for this MotorUserMessage based on its message content.String
toString()
Provides a string representation of this object.
-
Constructor Details
-
MotorUserMessage
Constructs a new MotorUserMessage with a specified user prompt.- Parameters:
message
- The text of the user prompt, not null, representing the user's input to the system.- Throws:
IllegalArgumentException
- If the specified message is null.
-
-
Method Details
-
getContent
Retrieves the text of the user prompt stored in this message.- Specified by:
getContent
in interfaceMotorMessage
- Returns:
- The text of the user prompt.
-
hashCode
public int hashCode()Computes the hash code for this MotorUserMessage based on its message content. -
equals
Compares this MotorUserMessage to the specified object to determine equality. Two MotorUserMessage objects are considered equal if their message texts are identical. -
toString
Provides a string representation of this object. The output includes the class name along with key attribute values.
-