Class CustomArgument.MessageBuilder

java.lang.Object
dev.jorel.commandapi.arguments.CustomArgument.MessageBuilder
All Implemented Interfaces:
Serializable
Enclosing class:
CustomArgument<T,B>

public static class CustomArgument.MessageBuilder extends Object implements Serializable
MessageBuilder is used to create error messages for invalid argument inputs
See Also:
  • Constructor Details

    • MessageBuilder

      public MessageBuilder()
      Create a blank message
    • MessageBuilder

      public MessageBuilder(String str)
      Create a message with an input string
      Parameters:
      str - The string to start the message with
  • Method Details

    • appendArgInput

      public CustomArgument.MessageBuilder appendArgInput()
      Appends the argument input that the CommandSender used in this command.
      For example, if /foo bar was executed and an error occurs with the CustomArgument bar, then the arg input will append bar to the end of the message.

      This input is determined at runtime, and is stored as %input% until executed
      Returns:
      A reference to this object
    • appendFullInput

      public CustomArgument.MessageBuilder appendFullInput()
      Appends the whole input that the CommandSender used in this command.
      For example, if /foo bar was executed, then foo bar will be appended to the end of the message.

      This input is determined at runtime, and is stored as %finput% until executed
      Returns:
      A reference to this object
    • appendHere

      public CustomArgument.MessageBuilder appendHere()
      Appends <--[HERE] to the end of the message
      Returns:
      A reference to this object
    • append

      Appends a string to the end of this message
      Parameters:
      str - The string to append to the end of this message
      Returns:
      A reference to this object
    • append

      Appends an object to the end of this message
      Parameters:
      obj - The object to append to the end of this message
      Returns:
      A reference to this object
    • toString

      public String toString()
      Returns the String content of this MessageBuilder
      Overrides:
      toString in class Object
      Returns:
      the String content of this MessageBuilder