Package ej.hoka.http
Class Cookie
- java.lang.Object
-
- ej.hoka.http.Cookie
-
public class Cookie extends Object
Web 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.StringgetDomain()Gets the domain.DategetExpires()Gets the expiration date.intgetMaxAge()Gets the max age of the cookie.StringgetName()Gets the name.StringgetPath()Gets the path.Cookie.SameSitegetSameSite()Gets the same site policy.StringgetValue()Gets the value.booleanisHttpOnly()Checks if the cookie is for http only.booleanisSecure()Checks if the cookie is secured.StringtoString()Returns a string representation of the object.
-
-
-
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()
-
getExpires
@Nullable public Date getExpires()
Gets the expiration date.- Returns:
- the expiration date (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 String toString()
Description copied from class:ObjectReturns a string representation of the object. In general, thetoStringmethod returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.The
toStringmethod for classObjectreturns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:getClass().getName() + '@' + Integer.toHexString(hashCode())
-
-