Class SimpleCookies

  • All Implemented Interfaces:
    io.micronaut.core.convert.value.ConvertibleValues<Cookie>, io.micronaut.core.value.ValueResolver<java.lang.CharSequence>, Cookies, java.lang.Iterable<java.util.Map.Entry<java.lang.String,​Cookie>>

    public class SimpleCookies
    extends java.lang.Object
    implements Cookies
    Simple Cookies implementation.
    Since:
    1.0
    • Field Summary

      • Fields inherited from interface io.micronaut.core.convert.value.ConvertibleValues

        EMPTY
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleCookies​(io.micronaut.core.convert.ConversionService conversionService)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<Cookie> findCookie​(java.lang.CharSequence name)
      Find a Cookie for the given name.
      <T> java.util.Optional<T> get​(java.lang.CharSequence name, io.micronaut.core.convert.ArgumentConversionContext<T> conversionContext)  
      <T> java.util.Optional<T> get​(java.lang.CharSequence name, java.lang.Class<T> requiredType)  
      java.util.Set<Cookie> getAll()  
      Cookie put​(java.lang.CharSequence name, Cookie cookie)
      Put a new cookie.
      void putAll​(java.util.Map<java.lang.CharSequence,​Cookie> cookies)
      Put a set of new cookies.
      java.util.Collection<Cookie> values()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.micronaut.core.convert.value.ConvertibleValues

        asMap, asMap, asProperties, contains, forEach, getValue, getValueType, isEmpty, iterator, subMap, subMap, subMap
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface io.micronaut.core.value.ValueResolver

        get, get
    • Constructor Detail

      • SimpleCookies

        public SimpleCookies​(io.micronaut.core.convert.ConversionService conversionService)
        Parameters:
        conversionService - The conversion service
    • Method Detail

      • getAll

        public java.util.Set<Cookie> getAll()
        Specified by:
        getAll in interface Cookies
        Returns:
        A set of the cookies
      • findCookie

        public java.util.Optional<Cookie> findCookie​(java.lang.CharSequence name)
        Description copied from interface: Cookies
        Find a Cookie for the given name.
        Specified by:
        findCookie in interface Cookies
        Parameters:
        name - The cookie
        Returns:
        An Optional cookie
      • get

        public <T> java.util.Optional<T> get​(java.lang.CharSequence name,
                                             java.lang.Class<T> requiredType)
        Specified by:
        get in interface io.micronaut.core.value.ValueResolver<java.lang.CharSequence>
      • get

        public <T> java.util.Optional<T> get​(java.lang.CharSequence name,
                                             io.micronaut.core.convert.ArgumentConversionContext<T> conversionContext)
        Specified by:
        get in interface io.micronaut.core.value.ValueResolver<java.lang.CharSequence>
      • values

        public java.util.Collection<Cookie> values()
        Specified by:
        values in interface io.micronaut.core.convert.value.ConvertibleValues<Cookie>
      • put

        public Cookie put​(java.lang.CharSequence name,
                          Cookie cookie)
        Put a new cookie.
        Parameters:
        name - the name of the cookie
        cookie - the cookie itself
        Returns:
        previous value for given name
      • putAll

        public void putAll​(java.util.Map<java.lang.CharSequence,​Cookie> cookies)
        Put a set of new cookies.
        Parameters:
        cookies - Map of cookie names and cookies