@Test public void acceptsOnlyNonNullName() { assertThrows(NullPointerException.class, () -> responseCookie(null, "value").build()); }
private ResponseCookie(Builder builder) { if (builder.name == null || builder.name.isEmpty()) { throw new IllegalArgumentException(); } this.name = builder.name; this.value = builder.value; this.domain = builder.domain; this.maxAge = builder.maxAge; this.path = builder.path; this.httpOnly = builder.httpOnly; this.secure = builder.secure; this.sameSite = builder.sameSite; this.hashCode = hash(name, value, domain, maxAge, path, secure, httpOnly, sameSite); }
ResponseCookie { private ResponseCookie(Builder builder) { if (builder.name == null || builder.name.isEmpty()) { throw new IllegalArgumentException(); } this.name = builder.name; this.value = builder.value; this.domain = builder.domain; this.maxAge = builder.maxAge; this.path = builder.path; this.httpOnly = builder.httpOnly; this.secure = builder.secure; this.sameSite = builder.sameSite; this.hashCode = hash(name, value, domain, maxAge, path, secure, httpOnly, sameSite); } }
ResponseCookie { private ResponseCookie(Builder builder) { if (builder.name == null || builder.name.isEmpty()) { throw new IllegalArgumentException(); } this.name = builder.name; this.value = builder.value; this.domain = builder.domain; this.maxAge = builder.maxAge; this.path = builder.path; this.httpOnly = builder.httpOnly; this.secure = builder.secure; this.sameSite = builder.sameSite; this.hashCode = hash(name, value, domain, maxAge, path, secure, httpOnly, sameSite); } private  ResponseCookie(Builder builder); }
ResponseCookie { private ResponseCookie(Builder builder) { if (builder.name == null || builder.name.isEmpty()) { throw new IllegalArgumentException(); } this.name = builder.name; this.value = builder.value; this.domain = builder.domain; this.maxAge = builder.maxAge; this.path = builder.path; this.httpOnly = builder.httpOnly; this.secure = builder.secure; this.sameSite = builder.sameSite; this.hashCode = hash(name, value, domain, maxAge, path, secure, httpOnly, sameSite); } private  ResponseCookie(Builder builder); static ResponseCookie.Builder responseCookie(String name, String value); static Set<ResponseCookie> decode(List<String> headerValues); String name(); String value(); Optional<Long> maxAge(); Optional<String> path(); boolean httpOnly(); Optional<String> domain(); boolean secure(); Optional<SameSite> sameSite(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
ResponseCookie { private ResponseCookie(Builder builder) { if (builder.name == null || builder.name.isEmpty()) { throw new IllegalArgumentException(); } this.name = builder.name; this.value = builder.value; this.domain = builder.domain; this.maxAge = builder.maxAge; this.path = builder.path; this.httpOnly = builder.httpOnly; this.secure = builder.secure; this.sameSite = builder.sameSite; this.hashCode = hash(name, value, domain, maxAge, path, secure, httpOnly, sameSite); } private  ResponseCookie(Builder builder); static ResponseCookie.Builder responseCookie(String name, String value); static Set<ResponseCookie> decode(List<String> headerValues); String name(); String value(); Optional<Long> maxAge(); Optional<String> path(); boolean httpOnly(); Optional<String> domain(); boolean secure(); Optional<SameSite> sameSite(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }