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 classWidgetUtil.Widget.Memberstatic classWidgetUtil.Widget.VoiceChannelstatic classWidgetUtil.Widget.VoiceState
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)longgetIdLong()The Snowflake id of this entity.java.lang.StringgetInviteCode()Gets an invite code for the guild, or null if no invite channel is enabled in the widgetWidgetUtil.Widget.MembergetMemberById(long id)Gets a member with the given ID, ornullif the member is not foundWidgetUtil.Widget.MembergetMemberById(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.StringgetName()Gets the name of the guildWidgetUtil.Widget.VoiceChannelgetVoiceChannelById(long id)Gets a voice channel with the given ID, ornullif the voice channel is not foundWidgetUtil.Widget.VoiceChannelgetVoiceChannelById(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 guildinthashCode()booleanisAvailable()Shows whether or not the widget for a guild is available.java.lang.StringtoString()-
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:ISnowflakeThe Snowflake id of this entity. This is unique to every entity and will never change.- Specified by:
getIdLongin 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 notavailablejava.lang.NumberFormatException- If the providedidcannot be parsed byLong.parseLong(String)
-
getVoiceChannelById
@Nullable public WidgetUtil.Widget.VoiceChannel getVoiceChannelById(long id)
Gets a voice channel with the given ID, ornullif 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 providedidcannot 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, ornullif 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-