Package ej.hoka.http
Class Cookie
- java.lang.Object
-
- ej.hoka.http.Cookie
-
public class Cookie extends java.lang.ObjectWeb Cookie.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCookie.BuilderCookie builder.static classCookie.SameSiteSame site values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Cookie.Builderbuilder()Configures and builds a cookie.java.lang.StringgetDomain()Gets the domain.java.util.DategetExpires()Gets the expiration date.intgetMaxAge()Gets the max age of the cookie.java.lang.StringgetName()Gets the name.java.lang.StringgetPath()Gets the path.Cookie.SameSitegetSameSite()Gets the same site policy.java.lang.StringgetValue()Gets the value.booleanisHttpOnly()Checks if the cookie is for http only.booleanisSecure()Checks if the cookie is secured.java.lang.StringtoString()
-
-
-
Method Detail
-
builder
public static Cookie.Builder builder()
Configures and builds a cookie.- Returns:
- builder instance to continue configuring the cookie or building the instance by calling
Cookie.Builder.build()
-
getName
@Nullable public java.lang.String getName()
Gets the name.- Returns:
- the name.
-
getValue
@Nullable public java.lang.String getValue()
Gets the value.- Returns:
- the value.
-
getExpires
@Nullable public java.util.Date getExpires()
Gets the expiration date.- Returns:
- the expiration date (may be null).
-
getDomain
@Nullable public java.lang.String getDomain()
Gets the domain.- Returns:
- the domain (may be null).
-
getPath
@Nullable public java.lang.String getPath()
Gets the path.- Returns:
- the path (may be null).
-
getMaxAge
public int getMaxAge()
Gets the max age of the cookie.- Returns:
- the maxAge.
-
isSecure
public boolean isSecure()
Checks if the cookie is secured.- Returns:
- true if the cookie is secured, false otherwise.
-
isHttpOnly
public boolean isHttpOnly()
Checks if the cookie is for http only.- Returns:
- true if the cookie is for http only, false otherwise.
-
getSameSite
@Nullable public Cookie.SameSite getSameSite()
Gets the same site policy.- Returns:
- the same site policy value (may be null).
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-