Interface BrigadierMappings<C,S>
@API(status=INTERNAL,
since="2.0.0")
public interface BrigadierMappings<C,S>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C,S> @NonNull BrigadierMappings<C, S> create()Returns a new instance of the default implementation.<T,K extends org.incendo.cloud.parser.ArgumentParser<C, T>>
@Nullable BrigadierMapping<C,K, S> Returns the mapper for the givenparserType.default <T,K extends org.incendo.cloud.parser.ArgumentParser<C, T>>
voidregisterMapping(@NonNull Class<K> parserType, @NonNull BrigadierMapping<?, K, S> mapping) Registers themappingfor the givenparserType.<K extends org.incendo.cloud.parser.ArgumentParser<C,?>>
voidregisterMappingUnsafe(@NonNull Class<K> parserType, @NonNull BrigadierMapping<?, ?, S> mapping) Registers themappingfor the givenparserType.
-
Method Details
-
create
Returns a new instance of the default implementation.- Type Parameters:
C- cloud command sender typeS- brigadier command source type- Returns:
- the mapping instance
-
mapping
<T,K extends org.incendo.cloud.parser.ArgumentParser<C, @Nullable BrigadierMapping<C,T>> K, mappingS> (@NonNull Class<K> parserType) Returns the mapper for the givenparserType.- Type Parameters:
T- the type produced by the parserK- the parser type- Parameters:
parserType- the parser type- Returns:
- the mapping, or
null
-
registerMapping
default <T,K extends org.incendo.cloud.parser.ArgumentParser<C, void registerMappingT>> (@NonNull Class<K> parserType, @NonNull BrigadierMapping<?, K, S> mapping) Registers themappingfor the givenparserType.- Type Parameters:
T- the type produced by the parserK- the parser type- Parameters:
parserType- the parser typemapping- the mapping
-
registerMappingUnsafe
<K extends org.incendo.cloud.parser.ArgumentParser<C,?>> void registerMappingUnsafe(@NonNull Class<K> parserType, @NonNull BrigadierMapping<?, ?, S> mapping) Registers themappingfor the givenparserType.- Type Parameters:
K- the parser type- Parameters:
parserType- the parser typemapping- the mapping
-