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:
  • Constructor Details

    • Region

      public Region(GatewayDiscordClient gateway, discord4j.discordjson.json.RegionData data)
      Constructs a Region with an associated GatewayDiscordClient and Discord data.
      Parameters:
      gateway - The GatewayDiscordClient associated to this object, must be non-null.
      data - The raw data as represented by Discord, must be non-null.
  • Method Details

    • getClient

      public GatewayDiscordClient getClient()
      Description copied from interface: DiscordObject
      Returns the GatewayDiscordClient that created this object. Methods in it are exclusively based on the entity cache or Store in use. Refer to calling getClient().rest() to access a DiscordClient that is capable of requesting entities directly from the REST API.
      Specified by:
      getClient in interface DiscordObject
      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.
    • toString

      public String toString()
      Overrides:
      toString in class Object