Module io.jooby
Package io.jooby

Interface WebSocketMessage

All Superinterfaces:
Value

public interface WebSocketMessage extends Value
Websocket message generated from a WebSocket.OnMessage callback. Message is a subclass.
Since:
2.2.0
Author:
edgar
  • Method Details

    • to

      @NonNull <T> T to(@NonNull Type type)
      Convert this value to the given type. Support values are single-value, array-value and object-value. Object-value can be converted to a JavaBean type.
      Type Parameters:
      T - Element type.
      Parameters:
      type - Type to convert.
      Returns:
      Instance of the type.
    • create

      @NonNull static WebSocketMessage create(@NonNull Context ctx, @NonNull byte[] bytes)
      Creates a websocket message.
      Parameters:
      ctx - HTTP context.
      bytes - Text message as byte array.
      Returns:
      A websocket message.
    • create

      @NonNull static WebSocketMessage create(@NonNull Context ctx, @NonNull String message)
      Creates a websocket message.
      Parameters:
      ctx - HTTP context.
      message - Text message.
      Returns:
      A websocket message.