Enum Class Platform

java.lang.Object
java.lang.Enum<Platform>
dev.objz.commandbridge.api.platform.Platform
All Implemented Interfaces:
Serializable, Comparable<Platform>, Constable

public enum Platform extends Enum<Platform>
Enumeration of the two supported bridge platforms: the Velocity proxy and backend servers.

Each constant identifies a category of server in the CommandBridge network. Use the factory methods backend(String) and velocity(String) to construct typed Platform.ServerTarget instances that can be passed to a message channel's target builder.


 // Target a specific backend server
 Platform.ServerTarget survival = Platform.backend("survival-1");

 // Target the Velocity proxy itself (multi-proxy setup)
 Platform.ServerTarget proxy = Platform.velocity("proxy-1");
 
See Also:
  • Enum Constant Details

    • BACKEND

      public static final Platform BACKEND
      Represents a backend Minecraft server (for example, Paper, Folia, or Bukkit).

      Use this platform when targeting backend servers to send messages via a channel.

    • VELOCITY

      public static final Platform VELOCITY
      Represents the Velocity proxy.

      Use this platform when targeting the proxy itself, for example in a multi-proxy setup where one Velocity instance acts as a client to another.

  • Method Details

    • values

      public static Platform[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Platform valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • target

      public Platform.ServerTarget target(String id)
      Creates a Platform.ServerTarget for this platform with the given identifier.
      Parameters:
      id - the unique server identifier
      Returns:
      a new ServerTarget bound to this platform
      See Also:
    • backend

      public static Platform.ServerTarget backend(String id)
      Creates a Platform.ServerTarget identifying a backend server.

      Equivalent to BACKEND.target(id).

      Parameters:
      id - the unique server identifier
      Returns:
      a ServerTarget with platform BACKEND
    • velocity

      public static Platform.ServerTarget velocity(String id)
      Creates a Platform.ServerTarget identifying a Velocity proxy server.

      Equivalent to VELOCITY.target(id).

      Parameters:
      id - the unique server identifier
      Returns:
      a ServerTarget with platform VELOCITY