@NotThreadSafe public class BasicClientCookieHC4 extends java.lang.Object implements org.apache.http.cookie.SetCookie, org.apache.http.cookie.ClientCookie, java.lang.Cloneable, java.io.Serializable
SetCookie.| Constructor and Description |
|---|
BasicClientCookieHC4(java.lang.String name,
java.lang.String value)
Default Constructor taking a name and a value.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone() |
boolean |
containsAttribute(java.lang.String name) |
java.lang.String |
getAttribute(java.lang.String name) |
java.lang.String |
getComment()
Returns the comment describing the purpose of this cookie, or
null if no such comment has been defined.
|
java.lang.String |
getCommentURL()
Returns null.
|
java.lang.String |
getDomain()
Returns domain attribute of the cookie.
|
java.util.Date |
getExpiryDate()
Returns the expiration
Date of the cookie, or null
if none exists. |
java.lang.String |
getName()
Returns the name.
|
java.lang.String |
getPath()
Returns the path attribute of the cookie
|
int[] |
getPorts()
Returns null.
|
java.lang.String |
getValue()
Returns the value.
|
int |
getVersion()
Returns the version of the cookie specification to which this
cookie conforms.
|
boolean |
isExpired(java.util.Date date)
Returns true if this cookie has expired.
|
boolean |
isPersistent()
Returns false if the cookie should be discarded at the end
of the "session"; true otherwise.
|
boolean |
isSecure() |
void |
setAttribute(java.lang.String name,
java.lang.String value) |
void |
setComment(java.lang.String comment)
If a user agent (web browser) presents this cookie to a user, the
cookie's purpose will be described using this comment.
|
void |
setDomain(java.lang.String domain)
Sets the domain attribute.
|
void |
setExpiryDate(java.util.Date expiryDate)
Sets expiration date.
|
void |
setPath(java.lang.String path)
Sets the path attribute.
|
void |
setSecure(boolean secure)
Sets the secure attribute of the cookie.
|
void |
setValue(java.lang.String value)
Sets the value
|
void |
setVersion(int version)
Sets the version of the cookie specification to which this
cookie conforms.
|
java.lang.String |
toString() |
public BasicClientCookieHC4(java.lang.String name,
java.lang.String value)
name - The name.value - The value.public java.lang.String getName()
getName in interface org.apache.http.cookie.Cookiepublic java.lang.String getValue()
getValue in interface org.apache.http.cookie.Cookiepublic void setValue(java.lang.String value)
setValue in interface org.apache.http.cookie.SetCookievalue - public java.lang.String getComment()
getComment in interface org.apache.http.cookie.CookiesetComment(String)public void setComment(java.lang.String comment)
setComment in interface org.apache.http.cookie.SetCookiecomment - getComment()public java.lang.String getCommentURL()
getCommentURL in interface org.apache.http.cookie.Cookiepublic java.util.Date getExpiryDate()
Date of the cookie, or null
if none exists.
Note: the object returned by this method is considered immutable. Changing it (e.g. using setTime()) could result in undefined behaviour. Do so at your peril.
getExpiryDate in interface org.apache.http.cookie.CookieDate, or null.setExpiryDate(java.util.Date)public void setExpiryDate(java.util.Date expiryDate)
Note: the object returned by this method is considered immutable. Changing it (e.g. using setTime()) could result in undefined behaviour. Do so at your peril.
setExpiryDate in interface org.apache.http.cookie.SetCookieexpiryDate - the Date after which this cookie is no longer valid.getExpiryDate()public boolean isPersistent()
isPersistent in interface org.apache.http.cookie.Cookiepublic java.lang.String getDomain()
getDomain in interface org.apache.http.cookie.CookiesetDomain(java.lang.String)public void setDomain(java.lang.String domain)
setDomain in interface org.apache.http.cookie.SetCookiedomain - The value of the domain attributegetDomain()public java.lang.String getPath()
getPath in interface org.apache.http.cookie.CookiesetPath(java.lang.String)public void setPath(java.lang.String path)
setPath in interface org.apache.http.cookie.SetCookiepath - The value of the path attributegetPath()public boolean isSecure()
isSecure in interface org.apache.http.cookie.Cookietrue if this cookie should only be sent over secure connections.setSecure(boolean)public void setSecure(boolean secure)
When true the cookie should only be sent using a secure protocol (https). This should only be set when the cookie's originating server used a secure protocol to set the cookie's value.
setSecure in interface org.apache.http.cookie.SetCookiesecure - The value of the secure attributeisSecure()public int[] getPorts()
getPorts in interface org.apache.http.cookie.Cookiepublic int getVersion()
getVersion in interface org.apache.http.cookie.CookiesetVersion(int)public void setVersion(int version)
setVersion in interface org.apache.http.cookie.SetCookieversion - the version of the cookie.getVersion()public boolean isExpired(java.util.Date date)
isExpired in interface org.apache.http.cookie.Cookiedate - Current timepublic void setAttribute(java.lang.String name,
java.lang.String value)
public java.lang.String getAttribute(java.lang.String name)
getAttribute in interface org.apache.http.cookie.ClientCookiepublic boolean containsAttribute(java.lang.String name)
containsAttribute in interface org.apache.http.cookie.ClientCookiepublic java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 1999-2015 The Apache Software Foundation. All rights reserved.