Package discord4j.common.close
Class CloseStatus
- java.lang.Object
-
- discord4j.common.close.CloseStatus
-
public class CloseStatus extends Object
Container for WebSocket "close" status codes and reasons.
-
-
Field Summary
Fields Modifier and Type Field Description static CloseStatus
ABNORMAL_CLOSE
static CloseStatus
NORMAL_CLOSE
-
Constructor Summary
Constructors Constructor Description CloseStatus(int code, String reason)
Create a newCloseStatus
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCode()
Return the websocket close code.Optional<String>
getReason()
Return a websocket close reason, if present.String
toString()
-
-
-
Field Detail
-
NORMAL_CLOSE
public static final CloseStatus NORMAL_CLOSE
-
ABNORMAL_CLOSE
public static final CloseStatus ABNORMAL_CLOSE
-
-
Constructor Detail
-
CloseStatus
public CloseStatus(int code, @Nullable String reason)
Create a newCloseStatus
instance.- Parameters:
code
- the status codereason
- the reason
-
-