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 class
Region.Id
Represents the different non-deprecated voice region ids.
-
Constructor Summary
Constructors Constructor Description Region(GatewayDiscordClient gateway, discord4j.discordjson.json.RegionData data)
Constructs aRegion
with an associatedGatewayDiscordClient
and Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GatewayDiscordClient
getClient()
Returns theGatewayDiscordClient
that created this object.discord4j.discordjson.json.RegionData
getData()
Gets the data of the region.String
getId()
Gets the unique ID for the region.String
getName()
Gets the name of the region.boolean
isCustom()
Gets if this is a custom voice region.boolean
isDeprecated()
Gets if this is a deprecated voice region.boolean
isOptimal()
Gets if the region is closest to the current user's serviceMediator.boolean
isVip()
Gets if this is a VIP region.String
toString()
-
-
-
Constructor Detail
-
Region
public Region(GatewayDiscordClient gateway, discord4j.discordjson.json.RegionData data)
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 Detail
-
getClient
public GatewayDiscordClient 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
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:
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.
-
-