valueOf static method

HttpStatus valueOf(
  1. int statusCode
)
override

Return the {status-code: HttpStatus} enum constant with the specified numeric value. @param statusCode the numeric value of the enum to be returned @return the enum constant with the specified numeric value @throws IllegalArgumentException if this enum has no constant for the specified numeric value

Implementation

static HttpStatus valueOf(int statusCode) {
  HttpStatus? status = resolve(statusCode);
  if (status == null) {
    throw StateError('No matching constant for [$statusCode]');
  }
  return status;
}