/** * Returns the comment describing the purpose of this cookie, or <code>null</code> if the cookie * has no comment. * * @return a <code>String</code> containing the comment, or <code>null</code> if none * @see #setComment */ public String getComment() { if (comment == null && usingLazyCookieState) { final String commentStr = lazyCookieState.getComment().toString(Charsets.ASCII_CHARSET); comment = (version == 1) ? unescape(commentStr) : null; } return comment; }
/** * Returns the domain name set for this cookie. The form of the domain name is set by RFC 2109. * * @return a <code>String</code> containing the domain name * @see #setDomain */ public String getDomain() { if (domain == null && usingLazyCookieState) { final String domainStr = lazyCookieState.getDomain().toString(Charsets.ASCII_CHARSET); if (domainStr != null) { domain = unescape(domainStr); } } return domain; }
@Override public void recycle() { name = null; value = null; comment = null; domain = null; maxAge = -1; path = null; secure = false; version = UNSET; isHttpOnly = false; if (usingLazyCookieState) { usingLazyCookieState = false; lazyCookieState.recycle(); } }
/** * Returns the value of the cookie. * * @return a <code>String</code> containing the cookie's present value * @see #setValue * @see Cookie */ public String getValue() { if (value == null && usingLazyCookieState) { value = unescape(lazyCookieState.getValue().toString(Charsets.ASCII_CHARSET)); } return value; }
/** * Returns the name of the cookie. The name cannot be changed after creation. * * @return a <code>String</code> specifying the cookie's name */ public String getName() { if (name == null && usingLazyCookieState) { name = lazyCookieState.getName().toString(Charsets.ASCII_CHARSET); } return name; }
/** * Returns the path on the server to which the browser returns this cookie. The cookie is visible * to all subpaths on the server. * * @return a <code>String</code> specifying a path that contains a servlet name, for example, * <i>/catalog</i> * @see #setPath */ public String getPath() { if (path == null && usingLazyCookieState) { path = unescape(lazyCookieState.getPath().toString(Charsets.ASCII_CHARSET)); } return path; }