Interface Encoder<R,T>

Type Parameters:
R - The result type after encoding.
T - The input type to be encoded.
All Superinterfaces:
Codec<R,T>
All Known Subinterfaces:
WebSocketSafeTypeEncoder<R,T>, WebSocketSafeTypeEncoder.TypeToByteArrayEncoder<T>, WebSocketSafeTypeEncoder.TypeToByteBufferEncoder<T>, WebSocketSafeTypeEncoder.TypeToJsonEncoder<T>, WebSocketSafeTypeEncoder.TypeToStringEncoder<T>

@Experimental public non-sealed interface Encoder<R,T> extends Codec<R,T>
A generic interface for encoding data from one type into another.

Implementations of this interface are responsible for converting objects into an encoded format.

Since:
3.5.0
  • Method Summary

    Modifier and Type
    Method
    Description
    encode(T t)
    Encodes the given input into its corresponding encoded representation.
  • Method Details

    • encode

      R encode(T t)
      Encodes the given input into its corresponding encoded representation.
      Parameters:
      t - The input to encode.
      Returns:
      The encoded result.