Class CloseStatus

    • 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 new CloseStatus instance.
        Parameters:
        code - the status code
        reason - the reason
    • Method Detail

      • getCode

        public int getCode()
        Return the websocket close code.
        Returns:
        a websocket close code
      • getReason

        public Optional<String> getReason()
        Return a websocket close reason, if present.
        Returns:
        an Optional containing a close reason if present, or empty otherwise