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>

public final class ServletCookieAdapter extends Object implements 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

    Constructors
    Constructor
    Description
    ServletCookieAdapter(jakarta.servlet.http.Cookie cookie)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compareTo(io.micronaut.http.cookie.Cookie o)
     
    @NonNull io.micronaut.http.cookie.Cookie
    domain(@Nullable String domain)
     
    jakarta.servlet.http.Cookie
     
    @Nullable String
     
    long
     
    @NonNull String
     
    @Nullable String
     
    @NonNull String
     
    @NonNull io.micronaut.http.cookie.Cookie
    httpOnly(boolean httpOnly)
     
    boolean
     
    boolean
     
    @NonNull io.micronaut.http.cookie.Cookie
    maxAge(long maxAge)
     
    @NonNull io.micronaut.http.cookie.Cookie
    path(@Nullable String path)
     
    @NonNull io.micronaut.http.cookie.Cookie
    secure(boolean secure)
     
    @NonNull io.micronaut.http.cookie.Cookie
    value(@NonNull String value)
     

    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

      @NonNull public @NonNull String getName()
      Specified by:
      getName in interface io.micronaut.http.cookie.Cookie
    • getValue

      @NonNull public @NonNull String getValue()
      Specified by:
      getValue in interface io.micronaut.http.cookie.Cookie
    • getDomain

      @Nullable public @Nullable String getDomain()
      Specified by:
      getDomain in interface io.micronaut.http.cookie.Cookie
    • getPath

      @Nullable public @Nullable String getPath()
      Specified by:
      getPath in interface io.micronaut.http.cookie.Cookie
    • isHttpOnly

      public boolean isHttpOnly()
      Specified by:
      isHttpOnly in interface io.micronaut.http.cookie.Cookie
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface io.micronaut.http.cookie.Cookie
    • getMaxAge

      public long getMaxAge()
      Specified by:
      getMaxAge in interface io.micronaut.http.cookie.Cookie
    • maxAge

      @NonNull public @NonNull io.micronaut.http.cookie.Cookie maxAge(long maxAge)
      Specified by:
      maxAge in interface io.micronaut.http.cookie.Cookie
    • value

      @NonNull public @NonNull io.micronaut.http.cookie.Cookie value(@NonNull @NonNull String value)
      Specified by:
      value in interface io.micronaut.http.cookie.Cookie
    • domain

      @NonNull public @NonNull io.micronaut.http.cookie.Cookie domain(@Nullable @Nullable String domain)
      Specified by:
      domain in interface io.micronaut.http.cookie.Cookie
    • path

      @NonNull public @NonNull io.micronaut.http.cookie.Cookie path(@Nullable @Nullable String path)
      Specified by:
      path in interface io.micronaut.http.cookie.Cookie
    • secure

      @NonNull public @NonNull io.micronaut.http.cookie.Cookie secure(boolean secure)
      Specified by:
      secure in interface io.micronaut.http.cookie.Cookie
    • httpOnly

      @NonNull public @NonNull io.micronaut.http.cookie.Cookie httpOnly(boolean httpOnly)
      Specified by:
      httpOnly in interface io.micronaut.http.cookie.Cookie
    • compareTo

      public int compareTo(io.micronaut.http.cookie.Cookie o)
      Specified by:
      compareTo in interface Comparable<io.micronaut.http.cookie.Cookie>