Encoder.Text (WebSocket 2.1 API Documentation - Apache Tomcat 10.1.57)
Description: declaration: package: jakarta.websocket, interface: Encoder, interface: Text

# Interface Encoder.Text<T>

Type Parameters:
  `T` - The type of object accepted by the encoder

All Superinterfaces:
  `Encoder`

Enclosing interface:
  `Encoder`

public static interface Encoder.Text<T> extends Encoder
An encoder that encodes an object of type T into a text WebSocket message.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface Encoder

  `Encoder.Binary<T>, Encoder.BinaryStream<T>, Encoder.Text<T>, Encoder.TextStream<T>`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `encode(T object)`
  Encodes the given object into a text string.

  ### Methods inherited from interface Encoder

  `destroy, init`

- ## Method Details

  - ### encode

    String encode(T object) throws EncodeException
    Encodes the given object into a text string.
    Parameters:
      `object` - The object to encode
    Returns:
      The encoded text string
    Throws:
      `EncodeException` - If the object cannot be encoded