소스 검색

add status utility methods

tags/2.0.1
Jonathan Cobb 4 년 전
부모
커밋
9e02dba96b
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. +6
    -1
      src/main/java/org/cobbzilla/util/http/HttpResponseBean.java

+ 6
- 1
src/main/java/org/cobbzilla/util/http/HttpResponseBean.java 파일 보기

@@ -33,7 +33,12 @@ public class HttpResponseBean {
@Getter @Setter private long contentLength;
@Getter @Setter private String contentType;

@JsonIgnore public boolean isOk() { return (status / 100) == 2; }
@JsonIgnore public boolean isOk() { return is2xx(); }
@JsonIgnore public boolean is1xx() { return (status / 100) == 1; }
@JsonIgnore public boolean is2xx() { return (status / 100) == 2; }
@JsonIgnore public boolean is3xx() { return (status / 100) == 3; }
@JsonIgnore public boolean is4xx() { return (status / 100) == 4; }
@JsonIgnore public boolean is5xx() { return (status / 100) == 5; }

public Map<String, Object> toMap () {
final Map<String, Object> map = new LinkedHashMap<>();


불러오는 중...
취소
저장