Package net.orbyfied.j8.command.argument
Interface TypeResolver
- All Known Implementing Classes:
ArgumentTypes.SystemTypeResolver,DelegatingNamespacedTypeResolver
public interface TypeResolver
A class that resolves and compiles
ArgumentTypes.-
Method Summary
Modifier and TypeMethodDescriptiondefault ArgumentType<?>compile(TypeIdentifier identifier) Compiles a type identifier into an argument type object.static TypeResolverdefault voidregister(ArgumentType<?> type) Registers the given type if this resolver allows it.ArgumentType<?>resolve(net.orbyfied.j8.registry.Identifier identifier) Resolves a type by identifier.
-
Method Details
-
memoryBacked
-
register
Registers the given type if this resolver allows it.- Parameters:
type- The type to register.- Throws:
UnsupportedOperationException- If the resolver is immutable.
-
resolve
Resolves a type by identifier.- Parameters:
identifier- The identifier.- Returns:
- The type or null if not found.
-
compile
Compiles a type identifier into an argument type object. By default it resolves the base type, and compiles generic type arguments if needed, then includes them and returns the result.- Parameters:
identifier- The type identifier/descriptor.- Returns:
- The argument type or null if not found/valid.
-