public final class PersistableHttpCookie
extends java.lang.Object
implements java.io.Serializable
HttpCookie
but with the difference that this class is serializable and immutable.
The publicly exposed fields have the same meanings as the corresponding getter in HttpCookie
.
Modifier and Type | Field and Description |
---|---|
java.lang.String |
comment |
java.lang.String |
commentURL |
boolean |
discard |
java.lang.String |
domain |
long |
maxAge |
java.lang.String |
name |
java.lang.String |
path |
java.lang.String |
portlist |
boolean |
secure |
java.lang.String |
value |
int |
version |
Constructor and Description |
---|
PersistableHttpCookie(java.net.HttpCookie httpCookie)
Conversion constructor initializing a new persistable cookie from an
HttpCookie object. |
PersistableHttpCookie(java.lang.String name,
java.lang.String value)
Creates a new cookie given the specified name and value.
|
Modifier and Type | Method and Description |
---|---|
java.net.HttpCookie |
toHttpCookie()
Returns a new
HttpCookie filled with the same contents as this object. |
public final java.lang.String comment
public final java.lang.String commentURL
public final boolean discard
public final java.lang.String domain
public final long maxAge
public final java.lang.String name
public final java.lang.String path
public final java.lang.String portlist
public final boolean secure
public final java.lang.String value
public final int version
public PersistableHttpCookie(java.lang.String name, java.lang.String value)
HttpCookie
object and sets the rest of the field from it. Therefore, the default values for the other
fields is the same as for a new HttpCookie
object.name
- the name, must be non-nullvalue
- the value, must be non-nullpublic PersistableHttpCookie(java.net.HttpCookie httpCookie)
HttpCookie
object. All fields are copied.httpCookie
- the HTTP cookie, must be non-null