Class PingOptions.Builder

java.lang.Object
com.velocitypowered.api.proxy.server.PingOptions.Builder
All Implemented Interfaces:
AbstractBuilder<PingOptions>
Enclosing class:
PingOptions

public static final class PingOptions.Builder extends Object implements AbstractBuilder<PingOptions>
A builder for PingOptions objects.
Since:
3.2.0
  • Method Details

    • version

      public PingOptions.Builder version(@NotNull @NotNull ProtocolVersion protocolVersion)
      Sets the protocol with which the server is to be pinged.
      Parameters:
      protocolVersion - the specified protocol
      Returns:
      this builder
    • timeout

      public PingOptions.Builder timeout(@NotNull @NotNull Duration timeout)
      Sets the maximum time to wait to get the required ServerPing.
      Parameters:
      timeout - the timeout duration A value of 0 means that the read-timeout value from the Velocity configuration will be used, while a negative value means that there will be no timeout.
      Returns:
      this builder
    • timeout

      public PingOptions.Builder timeout(long time, @NotNull @NotNull TimeUnit timeunit)
      Sets the maximum time to wait to get the required ServerPing.
      Parameters:
      time - the timeout duration A value of 0 means that the read-timeout value from the Velocity configuration will be used, while a negative value means that there will be no timeout.
      timeunit - the unit of time to be used to provide the timeout duration
      Returns:
      this builder
    • build

      @NotNull public @NotNull PingOptions build()
      Create a new PingOptions with the values of this Builder.
      Specified by:
      build in interface AbstractBuilder<PingOptions>
      Returns:
      a new PingOptions object