# Class SendResult

java.lang.Object
jakarta.websocket.SendResult

public final class SendResult extends Object

## Constructor Summary

Constructors
Constructor
Description
`SendResult()`
Deprecated.
Deprecated in WebSocket 2.2 and will be removed in a future version.
`SendResult(Session session)`
Create an instance for a successful message.
`SendResult(Session session, Throwable exception)`
Create an instance for an unsuccessful message.
`SendResult(Throwable exception)`
Deprecated.
Deprecated in WebSocket 2.2 and will be removed in a future version.

## Method Summary

Modifier and Type
Method
Description
`Throwable`
`getException()`
`Session`
`getSession()`
The WebSocket session in which the session was sent.
`boolean`
`isOK()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SendResult

public SendResult(Session session, Throwable exception)
Create an instance for an unsuccessful message.

Parameters:
  `session` - the WebSocket session in which the message was sent
  `exception` - The exception describing the failure when trying to send the message.

### SendResult

public SendResult(Session session)
Create an instance for a successful message.

Parameters:
  `session` - the WebSocket session in which the message was sent

### SendResult

@Deprecated public SendResult(Throwable exception)
Deprecated.
Deprecated in WebSocket 2.2 and will be removed in a future version. Use `SendResult(Session, Throwable)` as a replacement.
Create an instance for an unsuccessful message.

Parameters:
  `exception` - The exception describing the failure when trying to send the message.

### SendResult

@Deprecated public SendResult()
Deprecated.
Deprecated in WebSocket 2.2 and will be removed in a future version. Use `SendResult(Session, Throwable)` as a replacement.
Create an instance for a successful message.

## Method Details

### getException

public Throwable getException()

### isOK

public boolean isOK()

### getSession

public Session getSession()
The WebSocket session in which the session was sent.

Returns:
  the WebSocket session in which the session was sent or `null` if not known.