Constructor and Description |
---|
Cookies(Cookie... cookies) |
Cookies(List<Cookie> cookies) |
Modifier and Type | Method and Description |
---|---|
List<Cookie> |
asList() |
static Cookies |
cookies(Cookie cookie,
Cookie... additionalCookies)
An alternative way to create a Cookies object from the constructor.
|
boolean |
exist() |
Cookie |
get(String cookieName)
Get a single cookie with the supplied name.
|
List<Cookie> |
getList(String cookieName)
Get all cookies with the supplied name.
|
String |
getValue(String cookieName)
Get a single cookie value with the supplied name.
|
List<String> |
getValues(String cookieName)
Get all cookie values of the cookie with the supplied name.
|
boolean |
hasCookieWithName(String cookieName)
See if a cookie with the given name exists
|
Iterator<Cookie> |
iterator() |
protected List<Cookie> |
list() |
int |
size() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public Cookies(Cookie... cookies)
public int size()
public boolean exist()
true
if one or more cookies are defined, false
otherwise.public boolean hasCookieWithName(String cookieName)
cookieName
- The name of the cookie to checktrue
if the cookie existspublic Cookie get(String cookieName)
cookieName
then
the first one is returned.cookieName
- The name of the cookie to findnull
if no cookie was found.public String getValue(String cookieName)
cookieName
then
the first one is returned.cookieName
- The name of the cookie to findnull
if no cookie was found.public List<Cookie> getList(String cookieName)
cookieName
then
a list with only that cookie is returned.cookieName
- The name of the cookie to findpublic List<String> getValues(String cookieName)
cookieName
then
a list with only that cookie value is returned.cookieName
- The name of the header to findpublic static Cookies cookies(Cookie cookie, Cookie... additionalCookies)
cookie
- The cookie to be includedadditionalCookies
- Additional cookies to be included (optional)Copyright © 2010–2020. All rights reserved.