class CookieHeaderSerializer implements Serializer<Cookie> {

    @Override
    public String serialize(final Cookie cookie) {
        StringBuilder sb = new StringBuilder();
        sb.append(cookie.getName())
                .append(EQUALS)
                .append(StringUtilities.urlEncode(cookie.getValue()));

        if (cookie.getMaxAge() != -1) {
            sb.append(SEPARATOR)
                    .append("Expires")
                    .append(EQUALS)
                    .append(getExpires(cookie.getMaxAge()));
        }
        if (cookie.getPath() != null) {
            sb.append(SEPARATOR)
                    .append("Path")
                    .append(EQUALS)
                    .append(cookie.getPath());
        }
        if (cookie.getDomain() != null) {
            sb.append(SEPARATOR)
                    .append("Domain")
                    .append(EQUALS)
                    .append(cookie.getDomain());
        }
        if (cookie.getComment() != null) {
            sb.append(SEPARATOR)
                    .append("Comment")
                    .append(EQUALS)
                    .append(cookie.getComment());
        }
        if (cookie.isHttpOnly()) {
            sb.append(SEPARATOR)
                    .append("HttpOnly");
        }
        if (cookie.isSecure()) {
            sb.append(SEPARATOR)
                    .append("Secure");
        }

        return sb.toString();
    }

    public  CookieHeaderSerializer(final DateProvider dateProvider);

}