Package io.micronaut.servlet.engine
Class ServletCookieAdapter
java.lang.Object
io.micronaut.servlet.engine.ServletCookieAdapter
- All Implemented Interfaces:
io.micronaut.http.cookie.Cookie
,Serializable
,Comparable<io.micronaut.http.cookie.Cookie>
Adapts the Servlet Cookie API to
Cookie
.- Since:
- 1.0
- Author:
- graemerocher
- See Also:
-
Field Summary
Fields inherited from interface io.micronaut.http.cookie.Cookie
ATTRIBUTE_DOMAIN, ATTRIBUTE_EXPIRES, ATTRIBUTE_HTTP_ONLY, ATTRIBUTE_MAX_AGE, ATTRIBUTE_PATH, ATTRIBUTE_SAME_SITE, ATTRIBUTE_SECURE, UNDEFINED_MAX_AGE
-
Constructor Summary
ConstructorDescriptionServletCookieAdapter
(jakarta.servlet.http.Cookie cookie) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(io.micronaut.http.cookie.Cookie o) @NonNull io.micronaut.http.cookie.Cookie
jakarta.servlet.http.Cookie
@Nullable String
long
@NonNull String
getName()
@Nullable String
getPath()
@NonNull String
getValue()
@NonNull io.micronaut.http.cookie.Cookie
httpOnly
(boolean httpOnly) boolean
boolean
isSecure()
@NonNull io.micronaut.http.cookie.Cookie
maxAge
(long maxAge) @NonNull io.micronaut.http.cookie.Cookie
@NonNull io.micronaut.http.cookie.Cookie
secure
(boolean secure) @NonNull io.micronaut.http.cookie.Cookie
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.http.cookie.Cookie
configure, configure, getSameSite, httpOnly, maxAge, sameSite, secure
-
Constructor Details
-
ServletCookieAdapter
public ServletCookieAdapter(jakarta.servlet.http.Cookie cookie) Default constructor.- Parameters:
cookie
- The servlet cookie to adapt.
-
-
Method Details
-
getCookie
public jakarta.servlet.http.Cookie getCookie()- Returns:
- The backing servlet cookie
-
getName
- Specified by:
getName
in interfaceio.micronaut.http.cookie.Cookie
-
getValue
- Specified by:
getValue
in interfaceio.micronaut.http.cookie.Cookie
-
getDomain
- Specified by:
getDomain
in interfaceio.micronaut.http.cookie.Cookie
-
getPath
- Specified by:
getPath
in interfaceio.micronaut.http.cookie.Cookie
-
isHttpOnly
public boolean isHttpOnly()- Specified by:
isHttpOnly
in interfaceio.micronaut.http.cookie.Cookie
-
isSecure
public boolean isSecure()- Specified by:
isSecure
in interfaceio.micronaut.http.cookie.Cookie
-
getMaxAge
public long getMaxAge()- Specified by:
getMaxAge
in interfaceio.micronaut.http.cookie.Cookie
-
maxAge
@NonNull public @NonNull io.micronaut.http.cookie.Cookie maxAge(long maxAge) - Specified by:
maxAge
in interfaceio.micronaut.http.cookie.Cookie
-
value
- Specified by:
value
in interfaceio.micronaut.http.cookie.Cookie
-
domain
- Specified by:
domain
in interfaceio.micronaut.http.cookie.Cookie
-
path
- Specified by:
path
in interfaceio.micronaut.http.cookie.Cookie
-
secure
@NonNull public @NonNull io.micronaut.http.cookie.Cookie secure(boolean secure) - Specified by:
secure
in interfaceio.micronaut.http.cookie.Cookie
-
httpOnly
@NonNull public @NonNull io.micronaut.http.cookie.Cookie httpOnly(boolean httpOnly) - Specified by:
httpOnly
in interfaceio.micronaut.http.cookie.Cookie
-
compareTo
public int compareTo(io.micronaut.http.cookie.Cookie o) - Specified by:
compareTo
in interfaceComparable<io.micronaut.http.cookie.Cookie>
-