Interface BrigadierMappings<C,S>


@API(status=INTERNAL, since="2.0.0") public interface BrigadierMappings<C,S>
  • Method Summary

    Modifier and Type
    Method
    Description
    static <C, S> @NonNull BrigadierMappings<C,S>
    Returns a new instance of the default implementation.
    <T, K extends org.incendo.cloud.parser.ArgumentParser<C, T>>
    @Nullable BrigadierMapping<C,K,S>
    mapping(@NonNull Class<K> parserType)
    Returns the mapper for the given parserType.
    default <T, K extends org.incendo.cloud.parser.ArgumentParser<C, T>>
    void
    registerMapping(@NonNull Class<K> parserType, @NonNull BrigadierMapping<?,K,S> mapping)
    Registers the mapping for the given parserType.
    <K extends org.incendo.cloud.parser.ArgumentParser<C, ?>>
    void
    registerMappingUnsafe(@NonNull Class<K> parserType, @NonNull BrigadierMapping<?,?,S> mapping)
    Registers the mapping for the given parserType.
  • Method Details

    • create

      static <C, S> @NonNull BrigadierMappings<C,S> create()
      Returns a new instance of the default implementation.
      Type Parameters:
      C - cloud command sender type
      S - brigadier command source type
      Returns:
      the mapping instance
    • mapping

      <T, K extends org.incendo.cloud.parser.ArgumentParser<C, T>> @Nullable BrigadierMapping<C,K,S> mapping(@NonNull Class<K> parserType)
      Returns the mapper for the given parserType.
      Type Parameters:
      T - the type produced by the parser
      K - the parser type
      Parameters:
      parserType - the parser type
      Returns:
      the mapping, or null
    • registerMapping

      default <T, K extends org.incendo.cloud.parser.ArgumentParser<C, T>> void registerMapping(@NonNull Class<K> parserType, @NonNull BrigadierMapping<?,K,S> mapping)
      Registers the mapping for the given parserType.
      Type Parameters:
      T - the type produced by the parser
      K - the parser type
      Parameters:
      parserType - the parser type
      mapping - the mapping
    • registerMappingUnsafe

      <K extends org.incendo.cloud.parser.ArgumentParser<C, ?>> void registerMappingUnsafe(@NonNull Class<K> parserType, @NonNull BrigadierMapping<?,?,S> mapping)
      Registers the mapping for the given parserType.
      Type Parameters:
      K - the parser type
      Parameters:
      parserType - the parser type
      mapping - the mapping