/** * Decodes "Set-Cookie" header values and returns them as set of {@link ResponseCookie} objects. * * @return a set of {@link ResponseCookie} objects */ public Set<ResponseCookie> cookies() { return decode(headers.getAll(SET_COOKIE)); }
/** * Decodes the "Set-Cookie" headers in this response and returns the cookies. * * @return a set of cookies */ public Set<ResponseCookie> cookies() { return decode(headers.getAll(SET_COOKIE)); }
private Builder removeCookiesIf(Predicate<String> removeIfName) { Predicate<ResponseCookie> keepIf = cookie -> !removeIfName.test(cookie.name()); List<ResponseCookie> newCookies = decode(headers.getAll(SET_COOKIE)).stream() .filter(keepIf) .collect(toList()); return cookies(newCookies); }
private Builder removeCookiesIf(Predicate<String> removeIfName) { Predicate<ResponseCookie> keepIf = cookie -> !removeIfName.test(cookie.name()); List<ResponseCookie> newCookies = decode(headers.getAll(SET_COOKIE)).stream() .filter(keepIf) .collect(toList()); return cookies(newCookies); }