Interface DescriptionFacade
@Immutable
public interface DescriptionFacade
A general interface for dealing with command and command element descriptions.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetText()Returns the description text.default StringgetText(CommandSender sender) Returns the description text for the given locale holder.default booleanisEmpty()Returns whether this description is empty.default booleanisEmpty(CommandSender sender) Returns whether this description is empty for the given locale holder.static DescriptionFacadeCreates a text description, which is just a simple string.static DescriptionFacadetranslated(String key, Locale defaultLocale) Creates a new translated description.
-
Field Details
-
EMPTY
-
-
Method Details
-
text
Creates a text description, which is just a simple string.- Parameters:
text- the text- Returns:
- the created text description
-
translated
Creates a new translated description. It uses distributor global translation system to translate the given key with either the input locale or the default locale.- Parameters:
key- the translation keydefaultLocale- the default locale- Returns:
- the created translated description
-
getText
String getText()Returns the description text. -
getText
Returns the description text for the given locale holder.- Parameters:
sender- the command sender- Returns:
- the description text
-
isEmpty
default boolean isEmpty()Returns whether this description is empty. -
isEmpty
Returns whether this description is empty for the given locale holder.- Parameters:
sender- the command sender- Returns:
- whether this description is empty
-