public final class DefaultHttpSetCookie extends java.lang.Object implements HttpSetCookie
HttpSetCookie
.Constructor and Description |
---|
DefaultHttpSetCookie(java.lang.CharSequence name,
java.lang.CharSequence value)
Create a new not wrapped, not secure and not HTTP-only
HttpSetCookie instance, with no path, domain,
expire date and maximum age. |
DefaultHttpSetCookie(java.lang.CharSequence name,
java.lang.CharSequence value,
boolean wrapped,
boolean secure,
boolean httpOnly)
Create a new
HttpSetCookie instance, with no path, domain, expire date and maximum age. |
DefaultHttpSetCookie(java.lang.CharSequence name,
java.lang.CharSequence value,
java.lang.CharSequence path,
java.lang.CharSequence domain,
java.lang.CharSequence expires,
java.lang.Long maxAge,
boolean wrapped,
boolean secure,
boolean httpOnly)
Creates a new
HttpSetCookie instance. |
Modifier and Type | Method and Description |
---|---|
java.lang.CharSequence |
domain()
Returns the domain of this
HttpSetCookie . |
java.lang.CharSequence |
encoded()
Get the encoded value of this
HttpCookiePair . |
boolean |
equals(java.lang.Object o) |
java.lang.CharSequence |
expires()
Returns the expire date of this
HttpSetCookie according
to Expires. |
int |
hashCode() |
boolean |
isHttpOnly()
Checks to see if this
HttpSetCookie can only be accessed via HTTP. |
boolean |
isSecure()
Checks to see if this
HttpSetCookie is secure. |
boolean |
isWrapped()
Returns
true if the value should be wrapped in DQUOTE as described in
cookie-value. |
java.lang.Long |
maxAge()
Returns the maximum age of this
HttpSetCookie in seconds if specified. |
java.lang.CharSequence |
name()
Returns the name of this
HttpCookiePair . |
static HttpSetCookie |
parseSetCookie(java.lang.CharSequence setCookieString,
boolean validateContent)
|
java.lang.CharSequence |
path()
Returns the path of this
HttpSetCookie . |
java.lang.String |
toString() |
java.lang.CharSequence |
value()
Returns the value of this
HttpCookiePair . |
public DefaultHttpSetCookie(java.lang.CharSequence name, java.lang.CharSequence value)
HttpSetCookie
instance, with no path, domain,
expire date and maximum age.name
- the cookie-name.value
- the cookie-value.public DefaultHttpSetCookie(java.lang.CharSequence name, java.lang.CharSequence value, boolean wrapped, boolean secure, boolean httpOnly)
HttpSetCookie
instance, with no path, domain, expire date and maximum age.name
- the cookie-name.value
- the cookie-value.wrapped
- true
if the value should be wrapped in DQUOTE as described in
cookie-value.secure
- the secure-av.httpOnly
- the httponly-av (see
HTTP-only).public DefaultHttpSetCookie(java.lang.CharSequence name, java.lang.CharSequence value, @Nullable java.lang.CharSequence path, @Nullable java.lang.CharSequence domain, @Nullable java.lang.CharSequence expires, @Nullable java.lang.Long maxAge, boolean wrapped, boolean secure, boolean httpOnly)
HttpSetCookie
instance.name
- the cookie-name.value
- the cookie-value.path
- the path-value.domain
- the domain-value.expires
- the expires-av.
Represented as an RFC-1123 date defined in
RFC-2616, Section 3.3.1.maxAge
- the max-age-av.wrapped
- true
if the value should be wrapped in DQUOTE as described in
cookie-value.secure
- the secure-av.httpOnly
- the httponly-av (see
HTTP-only).public static HttpSetCookie parseSetCookie(java.lang.CharSequence setCookieString, boolean validateContent)
setCookieString
- The set-cookie-string
value.validateContent
- true
to make a best effort to validate the contents of the SetCookie.HttpSetCookie
representation of setCookie
.public java.lang.CharSequence name()
HttpCookiePair
HttpCookiePair
.name
in interface HttpCookiePair
HttpCookiePair
public java.lang.CharSequence value()
HttpCookiePair
HttpCookiePair
.value
in interface HttpCookiePair
HttpCookiePair
public boolean isWrapped()
HttpCookiePair
true
if the value should be wrapped in DQUOTE as described in
cookie-value.isWrapped
in interface HttpCookiePair
true
if the value should be wrapped in DQUOTE as described in
cookie-value.@Nullable public java.lang.CharSequence domain()
HttpSetCookie
HttpSetCookie
.domain
in interface HttpSetCookie
HttpSetCookie
@Nullable public java.lang.CharSequence path()
HttpSetCookie
HttpSetCookie
.path
in interface HttpSetCookie
HttpSetCookie
's path@Nullable public java.lang.Long maxAge()
HttpSetCookie
HttpSetCookie
in seconds if specified.maxAge
in interface HttpSetCookie
HttpSetCookie
. null
if none specified.@Nullable public java.lang.CharSequence expires()
HttpSetCookie
HttpSetCookie
according
to Expires.expires
in interface HttpSetCookie
HttpSetCookie
according
to Expires.public boolean isSecure()
HttpSetCookie
HttpSetCookie
is secure.isSecure
in interface HttpSetCookie
HttpSetCookie
is secure, otherwise falsepublic boolean isHttpOnly()
HttpSetCookie
HttpSetCookie
can only be accessed via HTTP.
If this returns true, the HttpSetCookie
cannot be accessed through
client side script - But only if the browser supports it.
For more information, please look hereisHttpOnly
in interface HttpSetCookie
HttpSetCookie
is HTTP-only or false if it isn'tpublic java.lang.CharSequence encoded()
HttpCookiePair
HttpCookiePair
.encoded
in interface HttpCookiePair
HttpCookiePair
.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object