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 CloseStatusABNORMAL_CLOSEstatic CloseStatusNORMAL_CLOSE
-
Constructor Summary
Constructors Constructor Description CloseStatus(int code, String reason)Create a newCloseStatusinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCode()Return the websocket close code.Optional<String>getReason()Return a websocket close reason, if present.StringtoString()
-
-
-
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 newCloseStatusinstance.- Parameters:
code- the status codereason- the reason
-
-