Interface DescriptionFacade


@Immutable public interface DescriptionFacade
A general interface for dealing with command and command element descriptions.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final DescriptionFacade
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the description text.
    default String
    Returns the description text for the given locale holder.
    default boolean
    Returns whether this description is empty.
    default boolean
    Returns whether this description is empty for the given locale holder.
    text(String text)
    Creates a text description, which is just a simple string.
    translated(String key, Locale defaultLocale)
    Creates a new translated description.
  • Field Details

  • Method Details

    • text

      static DescriptionFacade text(String text)
      Creates a text description, which is just a simple string.
      Parameters:
      text - the text
      Returns:
      the created text description
    • translated

      static DescriptionFacade translated(String key, Locale defaultLocale)
      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 key
      defaultLocale - the default locale
      Returns:
      the created translated description
    • getText

      String getText()
      Returns the description text.
    • getText

      default String getText(CommandSender sender)
      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

      default boolean isEmpty(CommandSender sender)
      Returns whether this description is empty for the given locale holder.
      Parameters:
      sender - the command sender
      Returns:
      whether this description is empty