|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.ws.rs.core.Cookie
public class Cookie
Represents the value of a HTTP cookie, transferred in a request. RFC 2109 specifies the legal characters for name, value, path and domain. The default version of 1 corresponds to RFC 2109.
Field Summary | |
---|---|
static int |
DEFAULT_VERSION
Cookies using the default version correspond to RFC 2109. |
Constructor Summary | |
---|---|
Cookie(String name,
String value)
Create a new instance. |
|
Cookie(String name,
String value,
String path,
String domain)
Create a new instance. |
|
Cookie(String name,
String value,
String path,
String domain,
int version)
Create a new instance. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Compare for equality. |
String |
getDomain()
Get the domain of the cookie. |
String |
getName()
Get the name of the cookie. |
String |
getPath()
Get the path of the cookie. |
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. |
String |
toString()
Convert the cookie to a string suitable for use as the value of the corresponding HTTP header. |
static Cookie |
valueOf(String value)
Creates a new instance of Cookie by parsing the supplied string. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_VERSION
Constructor Detail |
---|
public Cookie(String name, String value, String path, String domain, int version) throws IllegalArgumentException
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.
IllegalArgumentException
- if name is null
.public Cookie(String name, String value, String path, String domain) throws IllegalArgumentException
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.
IllegalArgumentException
- if name is null
.public Cookie(String name, String value) throws IllegalArgumentException
name
- the name of the cookie.value
- the value of the cookie.
IllegalArgumentException
- if name is null
.Method Detail |
---|
public static Cookie valueOf(String value) throws IllegalArgumentException
Cookie
by parsing the supplied string.
value
- the cookie string.
Cookie
.
IllegalArgumentException
- if the supplied string cannot be parsed
or is null
.public String getName()
public String getValue()
public int getVersion()
public String getDomain()
public String getPath()
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- the object to compare to.
true
, if the object is a Cookie
with the same
value for all properties, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |