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.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MotorUserMessage

      public MotorUserMessage​(String message)
      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

      public String getContent()
      Retrieves the text of the user prompt stored in this message.
      Specified by:
      getContent in interface MotorMessage
      Returns:
      The text of the user prompt.
    • hashCode

      public int hashCode()
      Computes the hash code for this MotorUserMessage based on its message content.
      Overrides:
      hashCode in class Object
      Returns:
      A hash code value for this object, derived from the message text.
    • equals

      public boolean equals​(Object obj)
      Compares this MotorUserMessage to the specified object to determine equality. Two MotorUserMessage objects are considered equal if their message texts are identical.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare with this MotorUserMessage for equality.
      Returns:
      true if the given object represents a MotorUserMessage equivalent to this instance, false otherwise.
    • toString

      public String toString()
      Provides a string representation of this object. The output includes the class name along with key attribute values.
      Overrides:
      toString in class Object
      Returns:
      a string description of this object.