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 forPingOptionsobjects.- Since:
- 3.2.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull PingOptionsbuild()Create a newPingOptionswith the values of this Builder.PingOptions.Buildertimeout(long time, @NotNull TimeUnit timeunit)Sets the maximum time to wait to get the requiredServerPing.PingOptions.Buildertimeout(@NotNull Duration timeout)Sets the maximum time to wait to get the requiredServerPing.PingOptions.Builderversion(@NotNull ProtocolVersion protocolVersion)Sets the protocol with which the server is to be pinged.
-
-
-
Method Detail
-
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 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
public PingOptions.Builder timeout(long time, @NotNull @NotNull TimeUnit timeunit)
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
@NotNull public @NotNull PingOptions build()
Create a newPingOptionswith the values of this Builder.- Specified by:
buildin interfaceAbstractBuilder<PingOptions>- Returns:
- a new PingOptions object
-
-