Package discord4j.core.object
Class Region
java.lang.Object
discord4j.core.object.Region
- All Implemented Interfaces:
DiscordObject
A Discord voice region.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Represents the different non-deprecated voice region ids. -
Constructor Summary
ConstructorDescriptionRegion
(GatewayDiscordClient gateway, discord4j.discordjson.json.RegionData data) Constructs aRegion
with an associatedGatewayDiscordClient
and Discord data. -
Method Summary
Modifier and TypeMethodDescriptionReturns theGatewayDiscordClient
that created this object.discord4j.discordjson.json.RegionData
getData()
Gets the data of the region.getId()
Gets the unique ID for the region.getName()
Gets the name of the region.boolean
isCustom()
Gets if this is a custom voice region.boolean
Gets if this is a deprecated voice region.boolean
Gets if the region is closest to the current user's serviceMediator.boolean
isVip()
Gets if this is a VIP region.toString()
-
Constructor Details
-
Region
Constructs aRegion
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.
-
-
Method Details
-
getClient
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
getData
public discord4j.discordjson.json.RegionData getData()Gets the data of the region.- Returns:
- The data of the region.
-
getId
Gets the unique ID for the region.- Returns:
- The unique ID for the region.
-
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:
true
if this is a VIP region,false
otherwise.
-
isOptimal
public boolean isOptimal()Gets if the region is closest to the current user's serviceMediator.- Returns:
true
if the region is closest to the current user's serviceMediator,false
otherwise.
-
isDeprecated
public boolean isDeprecated()Gets if this is a deprecated voice region.- Returns:
true
if this is a deprecated voice region,false
otherwise.
-
isCustom
public boolean isCustom()Gets if this is a custom voice region.- Returns:
true
if this is a custom voice region,false
otherwise.
-
toString
-