Record Class WebsocketConnectionOptions

java.lang.Object
java.lang.Record
io.fluxzero.sdk.common.websocket.WebsocketConnectionOptions
Record Components:
headers - request headers to add to the WebSocket opening handshake
userProperties - mutable session metadata that should be available to endpoint callbacks after the session opens
connectTimeout - optional timeout for establishing the WebSocket connection
subprotocols - optional WebSocket subprotocols to advertise, ordered by preference

public record WebsocketConnectionOptions(Map<String, List<String>> headers, Map<String,Object> userProperties, Duration connectTimeout, List<String> subprotocols) extends Record
Connection settings for the low-level runtime websocket connector.

The collections passed to this record are defensively copied. Header names are passed through unchanged because the underlying connector forwards them to the runtime handshake as supplied.

  • Constructor Details

    • WebsocketConnectionOptions

      public WebsocketConnectionOptions(Map<String, List<String>> headers, Map<String,Object> userProperties, Duration connectTimeout, List<String> subprotocols)
      Creates an instance of a WebsocketConnectionOptions record class.
      Parameters:
      headers - the value for the headers record component
      userProperties - the value for the userProperties record component
      connectTimeout - the value for the connectTimeout record component
      subprotocols - the value for the subprotocols record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • headers

      public Map<String, List<String>> headers()
      Returns the value of the headers record component.
      Returns:
      the value of the headers record component
    • userProperties

      public Map<String,Object> userProperties()
      Returns the value of the userProperties record component.
      Returns:
      the value of the userProperties record component
    • connectTimeout

      public Duration connectTimeout()
      Returns the value of the connectTimeout record component.
      Returns:
      the value of the connectTimeout record component
    • subprotocols

      public List<String> subprotocols()
      Returns the value of the subprotocols record component.
      Returns:
      the value of the subprotocols record component