Package com.kristensoft.kdc
Class UdpClientParameters.Builder
- java.lang.Object
-
- com.kristensoft.kdc.Parameters.Builder<T>
-
- com.kristensoft.kdc.ClientParameters.Builder<UdpClientParameters.Builder>
-
- com.kristensoft.kdc.UdpClientParameters.Builder
-
- Enclosing class:
- UdpClientParameters
public static final class UdpClientParameters.Builder extends ClientParameters.Builder<UdpClientParameters.Builder>
BuildsUdpClientParametersinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()Creates a builder for configuring UDP client parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UdpClientParameters.BuilderaddEventHandler(UdpClientEventHandler handler)Adds an event handler to the UDP client event handlers.UdpClientParameters.BuilderaddEventHandlers(List<UdpClientEventHandler> handlers)Adds the specified event handlers to the UDP client event handlers.UdpClientParametersbuild()Builds the client parameters using the current builder configuration.UdpClientParameters.BuilderwithEventHandlers(List<UdpClientEventHandler> handlers)Replaces the UDP client event handlers with the specified handlers.UdpClientParameters.BuilderwithSocketOptions(UdpSocketOptions options)Sets the socket options object used by this UDP client.-
Methods inherited from class com.kristensoft.kdc.ClientParameters.Builder
withRemoteAddress, withRemoteAddress, withRemoteAddress, withRemoteAddress, withSendSyncTimeout
-
Methods inherited from class com.kristensoft.kdc.Parameters.Builder
addWhiteListEntry, registerApi, registerApi, registerApis, withAutoStart, withBindAddress, withBindAddress, withBindAddress, withCompressed, withConnectionQueuePoolSize, withCrc, withEncryptionKey, withLatencyMode, withLatencyReportingInterval, withMaxReceivedBufferSize, withMaxSendBufferSize, withSerializationFormat, withWhiteList
-
-
-
-
Method Detail
-
withSocketOptions
public UdpClientParameters.Builder withSocketOptions(UdpSocketOptions options)
Sets the socket options object used by this UDP client.- Parameters:
options- the UDP socket options object- Returns:
- this builder
- Throws:
IllegalArgumentException- ifoptionsisnull
-
addEventHandler
public UdpClientParameters.Builder addEventHandler(UdpClientEventHandler handler)
Adds an event handler to the UDP client event handlers.- Parameters:
handler- the UDP client event handler to add- Returns:
- this builder
- Throws:
IllegalArgumentException- ifhandlerisnull
-
addEventHandlers
public UdpClientParameters.Builder addEventHandlers(List<UdpClientEventHandler> handlers)
Adds the specified event handlers to the UDP client event handlers.Previously configured event handlers are retained.
- Parameters:
handlers- the UDP client event handlers to add- Returns:
- this builder
- Throws:
IllegalArgumentException- ifhandlersisnullor contains anullhandler
-
withEventHandlers
public UdpClientParameters.Builder withEventHandlers(List<UdpClientEventHandler> handlers)
Replaces the UDP client event handlers with the specified handlers.Any previously configured event handlers are removed.
- Parameters:
handlers- the UDP client event handlers to use- Returns:
- this builder
- Throws:
IllegalArgumentException- ifhandlersisnull
-
build
public UdpClientParameters build()
Builds the client parameters using the current builder configuration.- Specified by:
buildin classClientParameters.Builder<UdpClientParameters.Builder>- Returns:
- the configured client parameters.
-
-