@Test(expected = IllegalArgumentException.class) public void throwsExceptionWhenCookieIsNull() throws Exception { cookieHeaderDelegate.toString(null); }
@Override public String toString(Cookie cookie) { if (cookie == null) { throw new IllegalArgumentException(); } StringBuilder sb = new StringBuilder(); sb.append("$Version=").append(cookie.getVersion()).append(';'); sb.append(cookie.getName()).append('=').append(addQuotesIfHasWhitespace(cookie.getValue())); if (cookie.getDomain() != null) { sb.append(';').append("$Domain=").append(addQuotesIfHasWhitespace(cookie.getDomain())); } if (cookie.getPath() != null) { sb.append(';').append("$Path=").append(addQuotesIfHasWhitespace(cookie.getPath())); } return sb.toString(); }
CookieHeaderDelegate implements RuntimeDelegate.HeaderDelegate<Cookie> { @Override public String toString(Cookie cookie) { if (cookie == null) { throw new IllegalArgumentException(); } StringBuilder sb = new StringBuilder(); sb.append("$Version=").append(cookie.getVersion()).append(';'); sb.append(cookie.getName()).append('=').append(addQuotesIfHasWhitespace(cookie.getValue())); if (cookie.getDomain() != null) { sb.append(';').append("$Domain=").append(addQuotesIfHasWhitespace(cookie.getDomain())); } if (cookie.getPath() != null) { sb.append(';').append("$Path=").append(addQuotesIfHasWhitespace(cookie.getPath())); } return sb.toString(); } }
CookieHeaderDelegate implements RuntimeDelegate.HeaderDelegate<Cookie> { @Override public String toString(Cookie cookie) { if (cookie == null) { throw new IllegalArgumentException(); } StringBuilder sb = new StringBuilder(); sb.append("$Version=").append(cookie.getVersion()).append(';'); sb.append(cookie.getName()).append('=').append(addQuotesIfHasWhitespace(cookie.getValue())); if (cookie.getDomain() != null) { sb.append(';').append("$Domain=").append(addQuotesIfHasWhitespace(cookie.getDomain())); } if (cookie.getPath() != null) { sb.append(';').append("$Path=").append(addQuotesIfHasWhitespace(cookie.getPath())); } return sb.toString(); }  }
CookieHeaderDelegate implements RuntimeDelegate.HeaderDelegate<Cookie> { @Override public String toString(Cookie cookie) { if (cookie == null) { throw new IllegalArgumentException(); } StringBuilder sb = new StringBuilder(); sb.append("$Version=").append(cookie.getVersion()).append(';'); sb.append(cookie.getName()).append('=').append(addQuotesIfHasWhitespace(cookie.getValue())); if (cookie.getDomain() != null) { sb.append(';').append("$Domain=").append(addQuotesIfHasWhitespace(cookie.getDomain())); } if (cookie.getPath() != null) { sb.append(';').append("$Path=").append(addQuotesIfHasWhitespace(cookie.getPath())); } return sb.toString(); }  @Override Cookie fromString(String header); @Override String toString(Cookie cookie); }
CookieHeaderDelegate implements RuntimeDelegate.HeaderDelegate<Cookie> { @Override public String toString(Cookie cookie) { if (cookie == null) { throw new IllegalArgumentException(); } StringBuilder sb = new StringBuilder(); sb.append("$Version=").append(cookie.getVersion()).append(';'); sb.append(cookie.getName()).append('=').append(addQuotesIfHasWhitespace(cookie.getValue())); if (cookie.getDomain() != null) { sb.append(';').append("$Domain=").append(addQuotesIfHasWhitespace(cookie.getDomain())); } if (cookie.getPath() != null) { sb.append(';').append("$Path=").append(addQuotesIfHasWhitespace(cookie.getPath())); } return sb.toString(); }  @Override Cookie fromString(String header); @Override String toString(Cookie cookie);  }