Interface ParamConverter<T>

Type Parameters:
T - the type of object this argument should be parsed to
All Known Implementing Classes:
GuildChannelConverter, IntConverter, LongConverter, RoleConverter, StringConverter, UserConverter

public interface ParamConverter<T>
Parses a String into an object of parameterized type. It takes into account the context of a command to allow performing case by case parsing.
  • Method Summary

    Modifier and Type Method Description
    reactor.core.publisher.Mono<T> convert​(Context ctx, java.lang.String input)
    Accepts a String input and parses it into an object of type T.
    java.lang.Class<T> type()
    Returns the type of object resulting of the parsing.
  • Method Details

    • convert

      reactor.core.publisher.Mono<T> convert​(Context ctx, java.lang.String input)
      Accepts a String input and parses it into an object of type T. This method has asynchronous capabilities, and may error to indicate that it cannot be parsed to the desired object. An empty mono may represent the fact that an argument is optional, ignored or non applicable.
      Parameters:
      ctx - the context of a command that may influence the parsing process
      input - the input to parse
      Returns:
      a Mono emittng the result of the parsing, a error if the parsing fails, or empty if non applicable or not provided.
    • type

      java.lang.Class<T> type()
      Returns the type of object resulting of the parsing.
      Returns:
      a Class