Package com.unblu.sdk.core.configuration
Class UnbluCookie
java.lang.Object
com.unblu.sdk.core.configuration.UnbluCookie
Cookie representation for the Unblu sdk
used together with the UnbluClientConfiguration.Builder.setCustomCookies(Set)
of the configuration
-
Constructor Summary
ConstructorDescriptionUnbluCookie
(String key, String value) Constructs an UnbluCookie object from the parameters provided.UnbluCookie
(String key, String value, Date expires) Constructs an UnbluCookie object from the parameters providedUnbluCookie
(HttpCookie cookie) Constructs an UnbluCookie object from aHttpCookie
object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Set<UnbluCookie>
from
(List<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 Set<UnbluCookie>
Creates a Set<UnbluCookie> from a Map<String, String>.
Cookies created with this constructor never expire.getKey()
getValue()
int
hashCode()
-
Constructor Details
-
UnbluCookie
Constructs an UnbluCookie object from aHttpCookie
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
Constructs an UnbluCookie object from the parameters provided- Parameters:
key
- The cookie's namevalue
- The cookie's valueexpires
- The cookie's Expires attribute
-
UnbluCookie
Constructs an UnbluCookie object from the parameters provided.
Cookies created with this constructor never expire.- Parameters:
key
- The cookie's namevalue
- The cookie value
-
-
Method Details
-
getKey
- Returns:
- The name of the cookie
-
getValue
- Returns:
- The value of the cookie
-
getExpires
- Returns:
- The value of the cookie's Expires attribute
-
from
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
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
-
hashCode
public int hashCode()
-