Package: io.vertx.groovy.core.http

## [Groovy] Class WebSocketFrame

- io.vertx.groovy.core.http.WebSocketFrame

- A WebSocket frame that represents either text or binary data.

  A WebSocket message is composed of one or more WebSocket frames.

  If there is a just a single frame in the message then a single text or binary frame should be created with final = true.

  If there are more than one frames in the message, then the first frame should be a text or binary frame with final = false, followed by one or more continuation frames. The last continuation frame should have final = true.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `WebSocketFrame (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `Buffer` | `binaryData()` @return Returns: the data of the frame
    `static WebSocketFrame` | `binaryFrame(Buffer data, boolean isFinal)` Create a binary WebSocket frame.
    `static WebSocketFrame` | `continuationFrame(Buffer data, boolean isFinal)` Create a continuation frame
    `java.lang.Object` | `getDelegate()`
    `boolean` | `isBinary()` @return Returns: true if it's a binary frame
    `boolean` | `isContinuation()` @return Returns: true if it's a continuation frame
    `boolean` | `isFinal()` Returns: true if this is the final frame.
    `boolean` | `isText()` @return Returns: true if it's a text frame
    `java.lang.String` | `textData()` Returns: the content of this frame as a UTF-8 string and returns the converted string.
    `static WebSocketFrame` | `textFrame(java.lang.String str, boolean isFinal)` Create a text WebSocket frame.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### WebSocketFrame(java.lang.Object delegate)

  - ### Method Detail

    - #### Buffer binaryData()

      Returns:
        the data of the frame

    - #### static WebSocketFrame binaryFrame(Buffer data, boolean isFinal)

      Create a binary WebSocket frame.

      Returns:
        the frame
      Parameters:
        `data` - the data for the frame
        `isFinal` - true if it's the final frame in the WebSocket message

    - #### static WebSocketFrame continuationFrame(Buffer data, boolean isFinal)

      Create a continuation frame

      Returns:
        the frame
      Parameters:
        `data` - the data for the frame
        `isFinal` - true if it's the final frame in the WebSocket message

    - #### java.lang.Object getDelegate()

    - #### boolean isBinary()

      Returns:
        true if it's a binary frame

    - #### boolean isContinuation()

      Returns:
        true if it's a continuation frame

    - #### boolean isFinal()

      Returns:
        true if this is the final frame.

    - #### boolean isText()

      Returns:
        true if it's a text frame

    - #### java.lang.String textData()

      Returns:
        the content of this frame as a UTF-8 string and returns the converted string. Only use this for text frames.

    - #### static WebSocketFrame textFrame(java.lang.String str, boolean isFinal)

      Create a text WebSocket frame.

      Returns:
        the frame
      Parameters:
        `str` - the string for the frame
        `isFinal` - true if it's the final frame in the WebSocket message