Interface AliasProvider
- All Superinterfaces:
Function<StringSplitter.Async.Iterator,,StringSplitter.Async.Iterator> UnaryOperator<StringSplitter.Async.Iterator>
- 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 AliasProvider
extends UnaryOperator<StringSplitter.Async.Iterator>
Provides aliases that apply to message-based commands.
- Since:
- 1.0
- Version:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionApplies aliases to the given iterator over received raw tokens.static AliasProvidernone()Creates an alias provider with no aliases.static AliasProviderof(Collection<? extends Map.Entry<Invocation, Invocation>> aliases) Creates an alias provider with the given aliases.static AliasProviderof(Map.Entry<Invocation, Invocation>... aliases) Creates an alias provider with the given aliases.static AliasProviderof(Map<Invocation, Invocation> aliases) Creates an alias provider with the given aliases.
-
Method Details
-
apply
Applies aliases to the given iterator over received raw tokens.- Specified by:
applyin interfaceFunction<StringSplitter.Async.Iterator,StringSplitter.Async.Iterator> - Parameters:
iter- The arg iterator to apply aliases to.- Returns:
- The iterator over the equivalent invocation with any aliases applied.
- Implementation Requirements:
- Implementations should not consume all elements in the given iterator
before checking for aliases, both due to performance concerns and due to
interfering with argument parsing. More specifically, the value of
StringSplitter.Async.Iterator.remainder()after the aliased portion should be exactly the same before or after applying the alias.
-
of
Creates an alias provider with the given aliases.- Parameters:
aliases- The aliases to use in the created provider.- Returns:
- The constructed provider.
-
of
Creates an alias provider with the given aliases.- Parameters:
aliases- The aliases to use in the created provider.- Returns:
- The constructed provider.
-
of
Creates an alias provider with the given aliases.- Parameters:
aliases- The aliases to use in the created provider.- Returns:
- The constructed provider.
-
none
Creates an alias provider with no aliases.- Returns:
- The constructed provider.
-