public static ResponseStatus valueOf ( int code ) { code = code & 0xFFFF ; // convert negative shorts to unsigned if ( code < 256 ) { ResponseStatus status = values [ code ] ; if ( status != null ) { return status ; } } return new ResponseStatus ( code ) ; }
Returns the ResponseStatus with the given status code . For recognized codes this method is guaranteed to always return the same ResponseStatus instance so it s safe to use == for equality checks against the pre - defined constants .