dev.jorel.commandapi.arguments.SafeOverrideable Maven / Gradle / Ivy
package dev.jorel.commandapi.arguments;
import dev.jorel.commandapi.ChainableBuilder;
import java.util.function.Function;
public interface SafeOverrideable
/// @endcond
, Argument
/// @cond DOX
extends AbstractArgument, ?, Argument, CommandSender>
/// @endcond
, CommandSender> extends ChainableBuilder {
// Links to methods in AbstractArgument (make sure they have the same signature)
Impl replaceSuggestions(ArgumentSuggestions suggestions);
Impl includeSuggestions(ArgumentSuggestions suggestions);
// SafeOverrideableArgument info
Function getMapper();
/**
* Replaces the suggestions with a safe {@link SafeSuggestions} object. Use the
* static methods in {@link SafeSuggestions} to create safe suggestions.
*
* @param suggestions The safe suggestions to use
* @return the current argument
*/
default Impl replaceSafeSuggestions(SafeSuggestions suggestions) {
return replaceSuggestions(suggestions.toSuggestions(getMapper()));
}
/**
* Includes the suggestions provided with the existing suggestions for this
* argument. Use the static methods in {@link SafeSuggestions} to create safe
* suggestions.
*
* @param suggestions The safe suggestions to use
* @return the current argument
*/
default Impl includeSafeSuggestions(SafeSuggestions suggestions) {
return includeSuggestions(suggestions.toSuggestions(getMapper()));
}
}