src/main/java/com/jmsoftware/datastructuresandalgorithms/common/constant/HttpStatus.java
/**
     * From code http status.
     *
     * @param code the code
     * @return the http status
     */
From code http status.
@param code the code
@return the http status
From code http status . @param code the code @return the http status
public static HttpStatus fromCode(Integer code) {
        HttpStatus[] httpStatuses = HttpStatus
                .values();
        for (HttpStatus httpStatus : httpStatuses) {
            if (httpStatus.getCode().equals(code)) {
                return httpStatus;
            }
        }
        throw new IllegalArgumentException(String.format("Cannot find HTTP status by code: %d!", code));
    }
public static HttpStatus fromCode ( Integer code ) { HttpStatus [ ] httpStatuses = HttpStatus . values ( ) ; for ( HttpStatus httpStatus : httpStatuses ) { if ( httpStatus . getCode ( ) . equals ( code ) ) { return httpStatus ; } } throw new IllegalArgumentException ( String . format ( "Cannot find HTTP status by code: %d!" , code ) ) ; }
From code http status.
From code http status .