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 Summary
Modifier and TypeMethodDescription@NotNull PingOptions
build()
Create a newPingOptions
with the values of this Builder.Sets the maximum time to wait to get the requiredServerPing
.Sets the maximum time to wait to get the requiredServerPing
.version
(@NotNull ProtocolVersion protocolVersion) Sets the protocol with which the server is to be pinged.
-
Method Details
-
version
Sets the protocol with which the server is to be pinged.- Parameters:
protocolVersion
- the specified protocol- Returns:
- this builder
-
timeout
Sets the maximum time to wait to get the requiredServerPing
.- 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
Sets the maximum time to wait to get the requiredServerPing
.- 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
Create a newPingOptions
with the values of this Builder.- Specified by:
build
in interfaceAbstractBuilder<PingOptions>
- Returns:
- a new PingOptions object
-