Package discord4j.core.object
Class Region
- java.lang.Object
-
- discord4j.core.object.Region
-
- All Implemented Interfaces:
DiscordObject
public final class Region extends Object implements DiscordObject
A Discord voice region.- See Also:
- Voice Region Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRegion.IdRepresents the different non-deprecated voice region ids.
-
Constructor Summary
Constructors Constructor Description Region(GatewayDiscordClient gateway, discord4j.discordjson.json.RegionData data)Constructs aRegionwith an associatedGatewayDiscordClientand Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GatewayDiscordClientgetClient()Returns theGatewayDiscordClientthat created this object.discord4j.discordjson.json.RegionDatagetData()Gets the data of the region.StringgetId()Gets the unique ID for the region.StringgetName()Gets the name of the region.booleanisCustom()Gets if this is a custom voice region.booleanisDeprecated()Gets if this is a deprecated voice region.booleanisOptimal()Gets if the region is closest to the current user's serviceMediator.booleanisVip()Gets if this is a VIP region.StringtoString()
-
-
-
Constructor Detail
-
Region
public Region(GatewayDiscordClient gateway, discord4j.discordjson.json.RegionData data)
Constructs aRegionwith an associatedGatewayDiscordClientand Discord data.- Parameters:
gateway- TheGatewayDiscordClientassociated to this object, must be non-null.data- The raw data as represented by Discord, must be non-null.
-
-
Method Detail
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObjectReturns theGatewayDiscordClientthat created this object. Methods in it are exclusively based on the entity cache orStorein use. Refer to callinggetClient().rest()to access aDiscordClientthat is capable of requesting entities directly from the REST API.- Specified by:
getClientin interfaceDiscordObject- Returns:
- The
GatewayDiscordClientassociated to this object.
-
getData
public discord4j.discordjson.json.RegionData getData()
Gets the data of the region.- Returns:
- The data of the region.
-
getId
public String getId()
Gets the unique ID for the region.- Returns:
- The unique ID for the region.
-
getName
public String getName()
Gets the name of the region.- Returns:
- The name of the region.
-
isVip
public boolean isVip()
Gets if this is a VIP region.- Returns:
trueif this is a VIP region,falseotherwise.
-
isOptimal
public boolean isOptimal()
Gets if the region is closest to the current user's serviceMediator.- Returns:
trueif the region is closest to the current user's serviceMediator,falseotherwise.
-
isDeprecated
public boolean isDeprecated()
Gets if this is a deprecated voice region.- Returns:
trueif this is a deprecated voice region,falseotherwise.
-
isCustom
public boolean isCustom()
Gets if this is a custom voice region.- Returns:
trueif this is a custom voice region,falseotherwise.
-
-