Class WidgetImpl

java.lang.Object
net.dv8tion.jda.internal.entities.WidgetImpl
All Implemented Interfaces:
ISnowflake, Widget

public class WidgetImpl extends Object implements Widget
  • Constructor Details

    • WidgetImpl

      public WidgetImpl(long guildId)
      Constructs an unavailable Widget
    • WidgetImpl

      public WidgetImpl(@Nonnull DataObject json)
      Constructs an available Widget
      Parameters:
      json - The DataObject to construct the Widget from
  • Method Details

    • isAvailable

      public boolean isAvailable()
      Description copied from interface: Widget
      Shows whether or not the widget for a guild is available. If this method returns false, all other values will be null
      Specified by:
      isAvailable in interface Widget
      Returns:
      True, if the widget is available, false otherwise
    • getIdLong

      public long getIdLong()
      Description copied from interface: ISnowflake
      The Snowflake id of this entity. This is unique to every entity and will never change.
      Specified by:
      getIdLong in interface ISnowflake
      Returns:
      Long containing the Id.
    • getName

      @Nonnull public String getName()
      Description copied from interface: Widget
      Gets the name of the guild
      Specified by:
      getName in interface Widget
      Returns:
      the name of the guild
    • getInviteCode

      @Nullable public String getInviteCode()
      Description copied from interface: Widget
      Gets an invite code for the guild, or null if no invite channel is enabled in the widget
      Specified by:
      getInviteCode in interface Widget
      Returns:
      an invite code for the guild, if widget invites are enabled
    • getVoiceChannels

      @Nonnull public List<Widget.VoiceChannel> getVoiceChannels()
      Description copied from interface: Widget
      Gets the list of voice channels in the guild
      Specified by:
      getVoiceChannels in interface Widget
      Returns:
      the list of voice channels in the guild
    • getVoiceChannelById

      @Nullable public Widget.VoiceChannel getVoiceChannelById(@Nonnull String id)
      Description copied from interface: Widget
      Gets a voice channel with the given ID, or null if the voice channel is not found
      Specified by:
      getVoiceChannelById in interface Widget
      Parameters:
      id - the ID of the voice channel
      Returns:
      possibly-null VoiceChannel with the given ID.
    • getVoiceChannelById

      @Nullable public Widget.VoiceChannel getVoiceChannelById(long id)
      Description copied from interface: Widget
      Gets a voice channel with the given ID, or null if the voice channel is not found
      Specified by:
      getVoiceChannelById in interface Widget
      Parameters:
      id - the ID of the voice channel
      Returns:
      possibly-null VoiceChannel with the given ID.
    • getMembers

      @Nonnull public List<Widget.Member> getMembers()
      Description copied from interface: Widget
      Gets a list of online members in the guild
      Specified by:
      getMembers in interface Widget
      Returns:
      the list of members
    • getMemberById

      @Nullable public Widget.Member getMemberById(@Nonnull String id)
      Description copied from interface: Widget
      Gets a member with the given ID, or null if the member is not found
      Specified by:
      getMemberById in interface Widget
      Parameters:
      id - the ID of the member
      Returns:
      possibly-null Member with the given ID.
    • getMemberById

      @Nullable public Widget.Member getMemberById(long id)
      Description copied from interface: Widget
      Gets a member with the given ID, or null if the member is not found
      Specified by:
      getMemberById in interface Widget
      Parameters:
      id - the ID of the member
      Returns:
      possibly-null Member with the given ID.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object