|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jayway.restassured.response.Cookie
public class Cookie
Cookie class represents a token or short packet of state information (also referred to as "magic-cookie") that the HTTP agent and the target server can exchange to maintain a session. In its simples form an HTTP cookie is merely a name / value pair. To construct a new new Cookie use the Builder like this:
Cookie cookie = new Cookie.Builder("name", "value").setComment("some comment").setExpiryDate(someDate).build();Credits: Some of the javadoc in this class is copied from the
org.apache.http.cookie.Cookie
class in Apache HTTP Client.
and some (version and secured) from Scalatra.
Nested Class Summary | |
---|---|
static class |
Cookie.Builder
|
Field Summary | |
---|---|
static String |
COMMENT
|
static String |
DOMAIN
|
static String |
EXPIRES
|
static String |
MAX_AGE
|
static String |
PATH
|
static String |
SECURE
|
static String |
VERSION
|
Method Summary | |
---|---|
boolean |
equals(Object o)
|
String |
getComment()
Returns the comment describing the purpose of this cookie, or null if no such comment has been defined. |
String |
getDomain()
Returns domain attribute of the cookie. |
Date |
getExpiryDate()
Returns the expiration Date of the cookie, or null
if none exists. |
int |
getMaxAge()
Returns the maximum age of the cookie, specified in seconds, By default, -1 indicating the cookie will persist
until browser shutdown. |
String |
getName()
Returns the name. |
String |
getPath()
Returns the path attribute of the cookie. |
String |
getValue()
Returns the value. |
int |
getVersion()
Gets the version of the cookie protocol this cookie complies with. |
boolean |
hasComment()
|
boolean |
hasDomain()
|
boolean |
hasExpiryDate()
|
int |
hashCode()
|
boolean |
hasMaxAge()
|
boolean |
hasPath()
|
boolean |
hasValue()
|
boolean |
hasVersion()
|
boolean |
isSecured()
Indicates to the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String COMMENT
public static final String PATH
public static final String DOMAIN
public static final String MAX_AGE
public static final String SECURE
public static final String EXPIRES
public static final String VERSION
Method Detail |
---|
public String getName()
getName
in interface NameAndValue
public String getValue()
getValue
in interface NameAndValue
public boolean hasValue()
true
if this cookie has a value defined, false
otherwise.public String getComment()
public boolean hasComment()
true
if this cookie has a comment defined, false
otherwise.public Date getExpiryDate()
Date
of the cookie, or null
if none exists.
Date
, or null.public boolean hasExpiryDate()
true
if this cookie has an expiry defined, false
otherwise.public String getDomain()
public boolean hasDomain()
true
if this cookie has a domain defined, false
otherwise.public String getPath()
public boolean hasPath()
true
if this cookie has a path defined, false
otherwise.public boolean isSecured()
true
if this cookies is secured.public int getVersion()
public boolean hasVersion()
true
if this cookie has a version defined, false
otherwise.public int getMaxAge()
-1
indicating the cookie will persist
until browser shutdown.
public boolean hasMaxAge()
true
if this cookie has a Max-Age defined, false
otherwise.public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |