Class ClientEndpointConfig.Builder
java.lang.Object
jakarta.websocket.ClientEndpointConfig.Builder
- Enclosing interface:
ClientEndpointConfig
Builder for creating
ClientEndpointConfig instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns aClientEndpointConfigwith the configured settings.configurator(ClientEndpointConfig.Configurator configurator) Sets the configurator to use for the WebSocket handshake.static ClientEndpointConfig.Buildercreate()Creates a newClientEndpointConfig.Builderinstance for building aClientEndpointConfig.Sets the list of decoder classes to use for the WebSocket connection.Sets the list of encoder classes to use for the WebSocket connection.extensions(List<Extension> extensions) Sets the list of extensions to use for the WebSocket connection.preferredSubprotocols(List<String> preferredSubprotocols) Sets the list of preferred sub-protocols for the WebSocket connection.sslContext(SSLContext sslContext) Sets the SSL context to use for secure WebSocket connections.
-
Method Details
-
create
Creates a newClientEndpointConfig.Builderinstance for building aClientEndpointConfig.- Returns:
- A new builder instance
-
build
Builds and returns aClientEndpointConfigwith the configured settings.- Returns:
- The configured client endpoint configuration
-
configurator
Sets the configurator to use for the WebSocket handshake.- Parameters:
configurator- The configurator, ornullto use the default- Returns:
- This builder instance
-
preferredSubprotocols
Sets the list of preferred sub-protocols for the WebSocket connection.- Parameters:
preferredSubprotocols- The list of sub-protocols in order of preference- Returns:
- This builder instance
-
extensions
Sets the list of extensions to use for the WebSocket connection.- Parameters:
extensions- The list of extensions- Returns:
- This builder instance
-
encoders
Sets the list of encoder classes to use for the WebSocket connection.- Parameters:
encoders- The list of encoder classes- Returns:
- This builder instance
-
decoders
Sets the list of decoder classes to use for the WebSocket connection.- Parameters:
decoders- The list of decoder classes- Returns:
- This builder instance
-
sslContext
Sets the SSL context to use for secure WebSocket connections.- Parameters:
sslContext- The SSL context, ornullfor default SSL behavior- Returns:
- This builder instance
-