Package io.undertow.server.handlers
Interface Cookie
- All Superinterfaces:
Comparable
- All Known Implementing Classes:
CookieImpl
A HTTP cookie.
- Author:
- Stuart Douglas
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault intdefault StringgetAttribute(String name) Returns the attribute associated with the name ornullif no attribute is associated with the name.Returns an unmodifiable map of the attributes associated with this cookie.getName()getPath()default StringgetValue()intbooleanbooleandefault booleanbooleanisSecure()default CookiesetAttribute(String name, String value) Sets an attribute for the cookie.setComment(String comment) setDiscard(boolean discard) setExpires(Date expires) setHttpOnly(boolean httpOnly) default CookiesetSameSite(boolean sameSite) default CookiesetSameSiteMode(String mode) setSecure(boolean secure) setVersion(int version)
-
Method Details
-
getName
String getName() -
getValue
String getValue() -
setValue
-
getPath
String getPath() -
setPath
-
getDomain
String getDomain() -
setDomain
-
getMaxAge
Integer getMaxAge() -
setMaxAge
-
isDiscard
boolean isDiscard() -
setDiscard
-
isSecure
boolean isSecure() -
setSecure
-
getVersion
int getVersion() -
setVersion
-
isHttpOnly
boolean isHttpOnly() -
setHttpOnly
-
getExpires
Date getExpires() -
setExpires
-
getComment
String getComment() -
setComment
-
isSameSite
default boolean isSameSite() -
setSameSite
-
getSameSiteMode
-
setSameSiteMode
-
getAttribute
Returns the attribute associated with the name ornullif no attribute is associated with the name.- Parameters:
name- the name of the attribute- Returns:
- the value or
nullif not found
-
setAttribute
Sets an attribute for the cookie. If the value isnull, the attribute is removed. If the value is notnull, the attribute is added to the attributes for this cookie.- Parameters:
name- the name of the attributevalue- the value of the attribute ornullto remove it- Returns:
- this cookie
-
getAttributes
Returns an unmodifiable map of the attributes associated with this cookie.- Returns:
- an unmodifiable map of the attributes
-
compareTo
- Specified by:
compareToin interfaceComparable
-