Class Post

java.lang.Object
org.tweetyproject.web.services.Post
Direct Known Subclasses:
InconsistencyPost

public class Post extends Object
Represents a generic data structure for HTTP POST requests. It encapsulates a command string, which is commonly used in the payload of POST requests. This class is typically used to simulate or construct POST request payloads within service-oriented architectures.
Author:
Jonas Klein
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for the Post class.
    Post(String cmd)
    Constructs a Post object with a specific command.
  • Method Summary

    Modifier and Type
    Method
    Description
    cmd(String cmd)
    Fluent API to set the command of this Post object and return the instance for chaining.
    boolean
    Determines whether this Post object is equal to another object.
    Retrieves the command string of this Post object.
    void
    Sets the command string for this Post object.
    Returns a string representation of this Post object.

    Methods inherited from class java.lang.Object

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

    • Post

      public Post()
      Default constructor for the Post class. Initializes an empty command string.
    • Post

      public Post(String cmd)
      Constructs a Post object with a specific command.
      Parameters:
      cmd - The command string to be used as part of the POST request payload.
  • Method Details

    • getCmd

      public String getCmd()
      Retrieves the command string of this Post object.
      Returns:
      The command string contained in this Post object.
    • setCmd

      public void setCmd(String cmd)
      Sets the command string for this Post object.
      Parameters:
      cmd - The command string to set for this Post object.
    • cmd

      public Post cmd(String cmd)
      Fluent API to set the command of this Post object and return the instance for chaining.
      Parameters:
      cmd - The command string to set.
      Returns:
      This Post object to enable method chaining.
    • equals

      public boolean equals(Object o)
      Determines whether this Post object is equal to another object. Two Post objects are considered equal if their command strings are the same.
      Overrides:
      equals in class Object
      Parameters:
      o - The object to compare with this Post.
      Returns:
      true if the specified object is a Post with the same command; false otherwise.
    • toString

      public String toString()
      Returns a string representation of this Post object.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this Post, consisting of its command.