Interface ArgumentTypeLookup<S extends CommandSource>

Type Parameters:
S - the source type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ArgumentTypeLookup<S extends CommandSource>
Functional interface for resolving nested/component types during argument type resolution.

This interface is passed to ArgumentTypeHandlers to allow them to recursively resolve ArgumentType instances for nested generic type parameters.

  • Method Details

    • lookup

      @NotNull <T> @NotNull Optional<ArgumentType<S,T>> lookup(@NotNull @NotNull Type type)
      Looks up an ArgumentType for the specified type.
      Type Parameters:
      T - the resolved type
      Parameters:
      type - the type to look up
      Returns:
      an optional containing the ArgumentType if found, empty otherwise
    • lookupOrThrow

      @NotNull default <T> @NotNull ArgumentType<S,T> lookupOrThrow(@NotNull @NotNull Type type)
      Looks up an ArgumentType for the specified type, throwing an exception if not found.
      Type Parameters:
      T - the resolved type
      Parameters:
      type - the type to look up
      Returns:
      the resolved ArgumentType
      Throws:
      IllegalArgumentException - if the type cannot be resolved