Quellcode durchsuchen

add status utility methods

tags/2.0.1
Jonathan Cobb vor 4 Jahren
Ursprung
Commit
9e02dba96b
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  1. +6
    -1
      src/main/java/org/cobbzilla/util/http/HttpResponseBean.java

+ 6
- 1
src/main/java/org/cobbzilla/util/http/HttpResponseBean.java Datei anzeigen

@@ -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<>();


Laden…
Abbrechen
Speichern