Interface IMentionable

All Superinterfaces:
Formattable, ISnowflake
All Known Subinterfaces:
ApplicationEmoji, AudioChannel, AudioChannelMixin<T>, AudioChannelUnion, Category, CategoryMixin<T>, Channel, ChannelMixin<T>, ChannelUnion, Command, CustomEmoji, DefaultGuildChannelUnion, ForumChannel, ForumChannelMixin<T>, GroupChannel, GroupChannelMixin<T>, GuildChannel, GuildChannelMixin<T>, GuildChannelUnion, GuildMessageChannel, GuildMessageChannelMixin<T>, GuildMessageChannelUnion, IAgeRestrictedChannel, IAgeRestrictedChannelMixin<T>, ICategorizableChannel, ICategorizableChannelMixin<T>, ICommandReference, ICopyableChannel, IInteractionPermissionMixin<T>, IInviteContainer, IInviteContainerMixin<T>, IMemberContainer, IPermissionContainer, IPermissionContainerMixin<T>, IPermissionContainerUnion, IPositionableChannel, IPositionableChannelMixin<T>, IPostContainer, IPostContainerMixin<T>, ISlowmodeChannel, ISlowmodeChannelMixin<T>, IThreadContainer, IThreadContainerMixin<T>, IThreadContainerUnion, ITopicChannelMixin<T>, IVoiceStatusChannel, IWebhookContainer, IWebhookContainerMixin<T>, IWebhookContainerUnion, MediaChannel, MediaChannelMixin<T>, Member, MemberMixin<T>, MessageChannel, MessageChannelMixin<T>, MessageChannelUnion, NewsChannel, NewsChannelMixin<T>, PrivateChannel, PrivateChannelMixin<T>, RichCustomEmoji, Role, RoleMixin<T>, SelfUser, StageChannel, StageChannelMixin<T>, StandardGuildChannel, StandardGuildChannelMixin<T>, StandardGuildMessageChannel, StandardGuildMessageChannelMixin<T>, TextChannel, TextChannelMixin<T>, ThreadChannel, ThreadChannelMixin<T>, ThreadMember, User, UserSnowflake, VoiceChannel, VoiceChannelMixin<T>, Widget.Member
All Known Implementing Classes:
AbstractChannelImpl, AbstractGuildChannelImpl, AbstractStandardGuildChannelImpl, AbstractStandardGuildMessageChannelImpl, ApplicationEmojiImpl, CategoryImpl, Command.Subcommand, Command.SubcommandGroup, CommandImpl, CustomEmojiImpl, DetachedCategoryImpl, DetachedForumChannelImpl, DetachedGroupChannelImpl, DetachedMediaChannelImpl, DetachedMemberImpl, DetachedNewsChannelImpl, DetachedPrivateChannelImpl, DetachedRoleImpl, DetachedStageChannelImpl, DetachedTextChannelImpl, DetachedThreadChannelImpl, DetachedVoiceChannelImpl, ForumChannelImpl, MediaChannelImpl, MemberImpl, NewsChannelImpl, PrivateChannelImpl, RichCustomEmojiImpl, RoleImpl, SelfUserImpl, SlashCommandReference, StageChannelImpl, TextChannelImpl, ThreadChannelImpl, ThreadMemberImpl, UserImpl, UserSnowflakeImpl, VoiceChannelImpl, WidgetImpl.MemberImpl

public interface IMentionable extends Formattable, ISnowflake
Marks a mentionable entity.

Formattable
This interface extends Formattable and can be used with a Formatter such as used by String.format(String, Object...) or PrintStream.printf(String, Object...).

This will use getAsMention() rather than Object.toString()!
Supported Features:

  • Width/Left-Justification
    - Ensures the size of a format (Example: %20s - uses at minimum 20 chars; %-10s - uses left-justified padding)
  • Precision
    - Cuts the content to the specified size (Example: %.20s)

More information on formatting syntax can be found in the format syntax documentation!
Note: Some implementations also support the alternative flag.

Since:
3.0
  • Method Details

    • getAsMention

      @Nonnull String getAsMention()
      Retrieve a Mention for this Entity. For the public Role (@everyone), this will return the literal string "@everyone".
      Returns:
      A resolvable mention.
    • formatTo

      default void formatTo(Formatter formatter, int flags, int width, int precision)
      Specified by:
      formatTo in interface Formattable