Class ArgumentEnum<E extends Enum<E>>

java.lang.Object
io.github.mqzn.commands.arguments.AbstractArgument<E>
io.github.mqzn.commands.arguments.ArgumentEnum<E>
All Implemented Interfaces:
Argument<E>

public final class ArgumentEnum<E extends Enum<E>> extends AbstractArgument<E>
  • Constructor Details

    • ArgumentEnum

      public ArgumentEnum(@NotNull @NotNull String id, Class<E> enumClass)
    • ArgumentEnum

      public ArgumentEnum(@NotNull @NotNull ArgumentData data, Class<E> enumClass)
  • Method Details

    • setFormat

      public ArgumentEnum<E> setFormat(@NotNull @NotNull ArgumentEnum.Format format)
    • parse

      @NotNull public <S> E parse(@NotNull S sender, @NotNull @NotNull String command, @NotNull @NotNull String input) throws ArgumentParseException
      Description copied from interface: Argument
      Parses the raw input into it's argument type The argument type must be registered and defined by the user
      Type Parameters:
      S - the sender type
      Parameters:
      sender - the sender of the command
      command - the command
      input - the raw argument
      Returns:
      the parsed object from raw
      Throws:
      ArgumentParseException - when it fails to parse the raw argument
    • entries

      public List<String> entries()
    • toString

      public String toString(E obj)
      Description copied from class: AbstractArgument
      changes the type of argument's object to a string
      Specified by:
      toString in interface Argument<E extends Enum<E>>
      Overrides:
      toString in class AbstractArgument<E extends Enum<E>>
      Parameters:
      obj - the object type of the argument
      Returns:
      object as string