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
-
-
Constructor Summary
Constructors Constructor Description Region(ServiceMediator serviceMediator, RegionBean data)
Constructs aRegion
with an associated ServiceMediator and Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DiscordClient
getClient()
Gets the DiscordClient associated to this object.String
getId()
Gets the unique ID for the region.String
getName()
Gets the name of the region.String
getSampleHostname()
Gets an example hostname for the region.int
getSamplePort()
Gets an example port for 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(ServiceMediator serviceMediator, RegionBean data)
Constructs aRegion
with an associated ServiceMediator and Discord data.- Parameters:
serviceMediator
- The ServiceMediator associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.
-
-
Method Detail
-
getClient
public DiscordClient getClient()
Description copied from interface:DiscordObject
Gets the DiscordClient associated to this object.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The DiscordClient associated to this object.
-
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.
-
getSampleHostname
public String getSampleHostname()
Gets an example hostname for the region.- Returns:
- An example hostname for the region.
-
getSamplePort
public int getSamplePort()
Gets an example port for the region.- Returns:
- An example port for 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.
-
-