public class Cookie
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Cookie.AbstractCookieBuilder<T extends Cookie.AbstractCookieBuilder<T>>
JAX-RS abstract
Cookie builder class. |
static class |
Cookie.Builder
JAX-RS
Cookie builder class. |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_VERSION
Cookies using the default version correspond to RFC 2109.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Cookie(Cookie.AbstractCookieBuilder<?> builder)
Create a new instance from the supplied
Cookie.AbstractCookieBuilder instance. |
|
Cookie(java.lang.String name,
java.lang.String value)
Deprecated.
This constructor will be removed in a future version. Please use
Cookie.Builder instead. |
|
Cookie(java.lang.String name,
java.lang.String value,
java.lang.String path,
java.lang.String domain)
Deprecated.
This constructor will be removed in a future version. Please use
Cookie.Builder instead. |
|
Cookie(java.lang.String name,
java.lang.String value,
java.lang.String path,
java.lang.String domain,
int version)
Deprecated.
This constructor will be removed in a future version. Please use
Cookie.Builder instead. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compare for equality.
|
java.lang.String |
getDomain()
Get the domain of the cookie.
|
java.lang.String |
getName()
Get the name of the cookie.
|
java.lang.String |
getPath()
Get the path of the cookie.
|
java.lang.String |
getValue()
Get the value of the cookie.
|
int |
getVersion()
Get the version of the cookie.
|
int |
hashCode()
Generate a hash code by hashing all of the cookies properties.
|
java.lang.String |
toString()
Deprecated.
The format of the toString() method is subject to change in a future version. Please use
RuntimeDelegate.getInstance().createHeaderDelegate(Cookie.class).toString(value) instead if you rely on the format of
this method.
|
static Cookie |
valueOf(java.lang.String value)
Deprecated.
This method will be removed in a future version. Please use
RuntimeDelegate.getInstance().createHeaderDelegate(Cookie.class).fromString(value) instead.
|
public static final int DEFAULT_VERSION
@Deprecated
public Cookie(java.lang.String name,
java.lang.String value,
java.lang.String path,
java.lang.String domain,
int version)
throws java.lang.IllegalArgumentException
Cookie.Builder instead.name - the name of the cookie.value - the value of the cookie.path - the URI path for which the cookie is valid.domain - the host domain for which the cookie is valid.version - the version of the specification to which the cookie complies.java.lang.IllegalArgumentException - if name is null.@Deprecated
public Cookie(java.lang.String name,
java.lang.String value,
java.lang.String path,
java.lang.String domain)
throws java.lang.IllegalArgumentException
Cookie.Builder instead.name - the name of the cookie.value - the value of the cookie.path - the URI path for which the cookie is valid.domain - the host domain for which the cookie is valid.java.lang.IllegalArgumentException - if name is null.@Deprecated
public Cookie(java.lang.String name,
java.lang.String value)
throws java.lang.IllegalArgumentException
Cookie.Builder instead.name - the name of the cookie.value - the value of the cookie.java.lang.IllegalArgumentException - if name is null.protected Cookie(Cookie.AbstractCookieBuilder<?> builder) throws java.lang.IllegalArgumentException
Cookie.AbstractCookieBuilder instance.builder - the builder.java.lang.IllegalArgumentException - if builder.name is null.@Deprecated public static Cookie valueOf(java.lang.String value)
Cookie by parsing the supplied string.value - the cookie string.Cookie.java.lang.IllegalArgumentException - if the supplied string cannot be parsed or is null.public java.lang.String getName()
public java.lang.String getValue()
public int getVersion()
public java.lang.String getDomain()
public java.lang.String getPath()
@Deprecated public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to compare to.true, if the object is a Cookie with the same value for all properties, false
otherwise.