Class UnbluCookie

    • Constructor Summary

      Constructors 
      Constructor Description
      UnbluCookie​(java.lang.String key, java.lang.String value)
      Constructs an UnbluCookie object from the parameters provided.
      UnbluCookie​(java.lang.String key, java.lang.String value, java.util.Date expires)
      Constructs an UnbluCookie object from the parameters provided
      UnbluCookie​(java.net.HttpCookie cookie)
      Constructs an UnbluCookie object from a HttpCookie object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      static java.util.Set<UnbluCookie> from​(java.util.List<java.net.HttpCookie> cookies)
      Creates a Set<UnbluCookie> from a Set<java.net.HttpCookie>.
      The constructor calculates each cookie's Expires attribute from its Max-Age attribute.
      static java.util.Set<UnbluCookie> from​(java.util.Map<java.lang.String,​java.lang.String> cookies)
      Creates a Set<UnbluCookie> from a Map<String, String>.
      Cookies created with this constructor never expire.
      java.util.Date getExpires()  
      java.lang.String getKey()  
      java.lang.String getValue()  
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UnbluCookie

        public UnbluCookie​(@NonNull
                           java.net.HttpCookie cookie)
        Constructs an UnbluCookie object from a HttpCookie object.
        The cookie's Expires attribute is calculated from its Max-Age attribute. Set Max-Age to -1 to ensure the cookie never expires.
        Parameters:
        cookie - The HttpCookie object from which to construct the UnbluCookie
      • UnbluCookie

        public UnbluCookie​(@NonNull
                           java.lang.String key,
                           @NonNull
                           java.lang.String value,
                           @Nullable
                           java.util.Date expires)
        Constructs an UnbluCookie object from the parameters provided
        Parameters:
        key - The cookie's name
        value - The cookie's value
        expires - The cookie's Expires attribute
      • UnbluCookie

        public UnbluCookie​(@NonNull
                           java.lang.String key,
                           @NonNull
                           java.lang.String value)
        Constructs an UnbluCookie object from the parameters provided.
        Cookies created with this constructor never expire.
        Parameters:
        key - The cookie's name
        value - The cookie value
    • Method Detail

      • getKey

        @NonNull
        public java.lang.String getKey()
        Returns:
        The name of the cookie
      • getValue

        @Nullable
        public java.lang.String getValue()
        Returns:
        The value of the cookie
      • getExpires

        @Nullable
        public java.util.Date getExpires()
        Returns:
        The value of the cookie's Expires attribute
      • from

        public static java.util.Set<UnbluCookie> from​(@NonNull
                                                      java.util.Map<java.lang.String,​java.lang.String> cookies)
        Creates a Set<UnbluCookie> from a Map<String, String>.
        Cookies created with this constructor never expire.
        Parameters:
        cookies - The custom cookie Map<key,value>
        Returns:
        Set
      • from

        public static java.util.Set<UnbluCookie> from​(@NonNull
                                                      java.util.List<java.net.HttpCookie> cookies)
        Creates a Set<UnbluCookie> from a Set<java.net.HttpCookie>.
        The constructor calculates each cookie's Expires attribute from its Max-Age attribute. Set Max-Age to -1 to ensure the cookie never expires.
        Parameters:
        cookies - The HttpCookie List<HttpCookie>
        Returns:
        Set
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object