java.lang.Object
com.developer.nefarious.zjoule.plugin.chat.models.Message

public class Message extends Object
Represents a single chat message with a role and content. This class is used to encapsulate a message's metadata, including its role (e.g., user, assistant, system) and its textual content.
  • Constructor Details

    • Message

      public Message()
      Default constructor for creating an empty Message.
    • Message

      public Message(Role role, String content)
      Constructs a Message with the specified role and content.
      Parameters:
      role - the role of the message (e.g., Role.USER, Role.SYSTEM).
      content - the textual content of the message.
  • Method Details

    • getContent

      public String getContent()
      Retrieves the content of the message.
      Returns:
      the content of the message as a String.
    • setContent

      public void setContent(String content)
      Sets the content of the message.
      Parameters:
      content - the new content of the message.
    • getRole

      public Role getRole()
      Retrieves the role of the message.
      Returns:
      the role of the message as a Role.
    • setRole

      public void setRole(Role role)
      Sets the role of the message.
      Parameters:
      role - the new role of the message (e.g., Role.USER, Role.ASSISTANT).