Package io.socket.client
Class SocketOptionBuilder
java.lang.Object
io.socket.client.SocketOptionBuilder
Convenient builder class that helps creating
Client Option
object as builder pattern.
Finally, you can get option object with call build()
method.- Author:
- junbong
-
Constructor Summary
ModifierConstructorDescriptionprotected
Construct new builder with default preferences.protected
SocketOptionBuilder
(IO.Options options) Construct this builder from specified option object. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finally retrieveIO.Options
object from this builder.static SocketOptionBuilder
builder()
Construct new builder with default preferences.static SocketOptionBuilder
builder
(IO.Options options) Construct this builder from specified option object.setExtraHeaders
(Map<String, List<String>> extraHeaders) setForceNew
(boolean forceNew) setHostname
(String hostname) setMultiplex
(boolean multiplex) setPolicyPort
(int policyPort) setPort
(int port) setRandomizationFactor
(double randomizationFactor) setReconnection
(boolean reconnection) setReconnectionAttempts
(int reconnectionAttempts) setReconnectionDelay
(long reconnectionDelay) setReconnectionDelayMax
(long reconnectionDelayMax) setRememberUpgrade
(boolean rememberUpgrade) setSecure
(boolean secure) setTimeout
(long timeout) setTransports
(String[] transports) setUpgrade
(boolean upgrade)
-
Constructor Details
-
SocketOptionBuilder
protected SocketOptionBuilder()Construct new builder with default preferences. -
SocketOptionBuilder
Construct this builder from specified option object. The option that returned frombuild()
method is not equals with given option. In other words, builder creates new option object and copy all preferences from given option.- Parameters:
options
- option object which to copy preferences. Null-ok.
-
-
Method Details
-
builder
Construct new builder with default preferences.- Returns:
- new builder object
- See Also:
-
builder
Construct this builder from specified option object. The option that returned frombuild()
method is not equals with given option. In other words, builder creates new option object and copy all preferences from given option.- Parameters:
options
- option object which to copy preferences- Returns:
- new builder object
-
setForceNew
-
setMultiplex
-
setReconnection
-
setReconnectionAttempts
-
setReconnectionDelay
-
setReconnectionDelayMax
-
setRandomizationFactor
-
setTimeout
-
setTransports
-
setUpgrade
-
setRememberUpgrade
-
setHost
-
setHostname
-
setPort
-
setPolicyPort
-
setQuery
-
setSecure
-
setPath
-
setAuth
-
setExtraHeaders
-
build
Finally retrieveIO.Options
object from this builder.- Returns:
- option that built from this builder
-