Class Argument

java.lang.Object
me.efekos.simpler.commands.syntax.Argument
Direct Known Subclasses:
DoubleArgument, IntegerArgument, ListArgument, PlayerArgument, StringArgument

public abstract class Argument extends Object
Used for your custom arguments. Extend this class for any type of argument you want.
  • Constructor Details

    • Argument

      public Argument()
      Used for your custom arguments. Extend this class for any type of argument you want.
  • Method Details

    • getPlaceHolder

      public abstract String getPlaceHolder()
      Returns a short placeholder to represent this argument. However, toString() is more recommended than this method if you want to represent this argument as a String.
      Returns:
      The placeholder of this argument. Placeholder is usually a one-word string that represents what this argument should be. For example: <player> argument should be the name of an OfflinePlayer. We are able to understand this, because that argument's placeholder is "player", meaning we should enter someone's name there.
    • getList

      public abstract List<String> getList(org.bukkit.entity.Player player, String current)
      Generates a list of suggestions about this argument.
      Parameters:
      player - Player who needs suggestions for this argument.
      current - Current string player entered so far.
      Returns:
      List of the strings player will see.
    • getPriority

      public abstract ArgumentPriority getPriority()
      Returns a priority about this argument.
      Returns:
      Priority of this argument. You can make your argument an optional or required argument using this.
    • handleCorrection

      public abstract ArgumentHandleResult handleCorrection(String given)
      Makes sure that the argument player wrote is valid.
      Parameters:
      given - The string that someone wrote as a value for this argument
      Returns:
      Is the given argument valid?
    • toString

      public String toString()
      Returns a string representation of this Argument.
      Overrides:
      toString in class Object
      Returns:
      A string that represents this.