@Test public void acceptsOnlyNonNullValue() { assertThrows(NullPointerException.class, () -> requestCookie("name", null)); }
private RequestCookie(String name, String value) { if (name == null || name.isEmpty()) { throw new IllegalArgumentException("name cannot be null or empty"); } requireNonNull(value, "value cannot be null"); this.name = name; this.value = value; this.hashCode = Objects.hash(name, value); }
RequestCookie { private RequestCookie(String name, String value) { if (name == null || name.isEmpty()) { throw new IllegalArgumentException("name cannot be null or empty"); } requireNonNull(value, "value cannot be null"); this.name = name; this.value = value; this.hashCode = Objects.hash(name, value); } }
RequestCookie { private RequestCookie(String name, String value) { if (name == null || name.isEmpty()) { throw new IllegalArgumentException("name cannot be null or empty"); } requireNonNull(value, "value cannot be null"); this.name = name; this.value = value; this.hashCode = Objects.hash(name, value); } private  RequestCookie(String name, String value); }
RequestCookie { private RequestCookie(String name, String value) { if (name == null || name.isEmpty()) { throw new IllegalArgumentException("name cannot be null or empty"); } requireNonNull(value, "value cannot be null"); this.name = name; this.value = value; this.hashCode = Objects.hash(name, value); } private  RequestCookie(String name, String value); static RequestCookie requestCookie(String name, String value); static Set<RequestCookie> decode(String headerValue); static String encode(Collection<RequestCookie> cookies); String name(); String value(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
RequestCookie { private RequestCookie(String name, String value) { if (name == null || name.isEmpty()) { throw new IllegalArgumentException("name cannot be null or empty"); } requireNonNull(value, "value cannot be null"); this.name = name; this.value = value; this.hashCode = Objects.hash(name, value); } private  RequestCookie(String name, String value); static RequestCookie requestCookie(String name, String value); static Set<RequestCookie> decode(String headerValue); static String encode(Collection<RequestCookie> cookies); String name(); String value(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }