Package net.dv8tion.jda.api.utils
Class WidgetUtil.Widget
- java.lang.Object
-
- net.dv8tion.jda.api.utils.WidgetUtil.Widget
-
- All Implemented Interfaces:
ISnowflake
- Enclosing class:
- WidgetUtil
public static class WidgetUtil.Widget extends java.lang.Object implements ISnowflake
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WidgetUtil.Widget.Member
static class
WidgetUtil.Widget.VoiceChannel
static class
WidgetUtil.Widget.VoiceState
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
long
getIdLong()
The Snowflake id of this entity.java.lang.String
getInviteCode()
Gets an invite code for the guild, or null if no invite channel is enabled in the widgetWidgetUtil.Widget.Member
getMemberById(long id)
Gets a member with the given ID, ornull
if the member is not foundWidgetUtil.Widget.Member
getMemberById(java.lang.String id)
Gets a member with the given ID, or null if the member is not foundjava.util.List<WidgetUtil.Widget.Member>
getMembers()
Gets a list of online members in the guildjava.lang.String
getName()
Gets the name of the guildWidgetUtil.Widget.VoiceChannel
getVoiceChannelById(long id)
Gets a voice channel with the given ID, ornull
if the voice channel is not foundWidgetUtil.Widget.VoiceChannel
getVoiceChannelById(java.lang.String id)
Gets a voice channel with the given ID, or null if the voice channel is not foundjava.util.List<WidgetUtil.Widget.VoiceChannel>
getVoiceChannels()
Gets the list of voice channels in the guildint
hashCode()
boolean
isAvailable()
Shows whether or not the widget for a guild is available.java.lang.String
toString()
-
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
-
-
-
Method Detail
-
isAvailable
public boolean isAvailable()
Shows whether or not the widget for a guild is available. If this method returns false, all other values will be null- 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 interfaceISnowflake
- Returns:
- Long containing the Id.
-
getName
@Nonnull public java.lang.String getName()
Gets the name of the guild- Returns:
- the name of the guild
- Throws:
java.lang.IllegalStateException
- If the widget is notavailable
-
getInviteCode
@Nullable public java.lang.String getInviteCode()
Gets an invite code for the guild, or null if no invite channel is enabled in the widget- Returns:
- an invite code for the guild, if widget invites are enabled
- Throws:
java.lang.IllegalStateException
- If the widget is notavailable
-
getVoiceChannels
@Nonnull public java.util.List<WidgetUtil.Widget.VoiceChannel> getVoiceChannels()
Gets the list of voice channels in the guild- Returns:
- the list of voice channels in the guild
- Throws:
java.lang.IllegalStateException
- If the widget is notavailable
-
getVoiceChannelById
@Nullable public WidgetUtil.Widget.VoiceChannel getVoiceChannelById(java.lang.String id)
Gets a voice channel with the given ID, or null if the voice channel is not found- Parameters:
id
- the ID of the voice channel- Returns:
- possibly-null VoiceChannel with the given ID.
- Throws:
java.lang.IllegalStateException
- If the widget is notavailable
java.lang.NumberFormatException
- If the providedid
cannot be parsed byLong.parseLong(String)
-
getVoiceChannelById
@Nullable public WidgetUtil.Widget.VoiceChannel getVoiceChannelById(long id)
Gets a voice channel with the given ID, ornull
if the voice channel is not found- Parameters:
id
- the ID of the voice channel- Returns:
- possibly-null VoiceChannel with the given ID.
- Throws:
java.lang.IllegalStateException
- If the widget is notavailable
-
getMembers
@Nonnull public java.util.List<WidgetUtil.Widget.Member> getMembers()
Gets a list of online members in the guild- Returns:
- the list of members
- Throws:
java.lang.IllegalStateException
- If the widget is notavailable
-
getMemberById
@Nullable public WidgetUtil.Widget.Member getMemberById(java.lang.String id)
Gets a member with the given ID, or null if the member is not found- Parameters:
id
- the ID of the member- Returns:
- possibly-null Member with the given ID.
- Throws:
java.lang.NumberFormatException
- If the providedid
cannot be parsed byLong.parseLong(String)
java.lang.IllegalStateException
- If the widget is notavailable
-
getMemberById
@Nullable public WidgetUtil.Widget.Member getMemberById(long id)
Gets a member with the given ID, ornull
if the member is not found- Parameters:
id
- the ID of the member- Returns:
- possibly-null Member with the given ID.
- Throws:
java.lang.IllegalStateException
- If the widget is notavailable
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-