Cookie
, org.refcodes.mixin.DomainAccessor
, org.refcodes.mixin.DomainAccessor.DomainBuilder<ResponseCookie>
, org.refcodes.mixin.DomainAccessor.DomainMutator
, org.refcodes.mixin.DomainAccessor.DomainProperty
, org.refcodes.mixin.KeyAccessor<String>
, org.refcodes.mixin.KeyAccessor.KeyBuilder<String,org.refcodes.structure.Relation.RelationBuilder<String,String>>
, org.refcodes.mixin.KeyAccessor.KeyMutator<String>
, org.refcodes.mixin.KeyAccessor.KeyProperty<String>
, org.refcodes.mixin.PathAccessor
, org.refcodes.mixin.PathAccessor.PathBuilder<ResponseCookie>
, org.refcodes.mixin.PathAccessor.PathMutator
, org.refcodes.mixin.PathAccessor.PathProperty
, org.refcodes.structure.Property
, org.refcodes.structure.Property.PropertyBuilder
, org.refcodes.structure.Relation<String,String>
, org.refcodes.structure.Relation.RelationBuilder<String,String>
, org.refcodes.mixin.ValueAccessor<String>
, org.refcodes.mixin.ValueAccessor.ValueBuilder<String,org.refcodes.structure.Relation.RelationBuilder<String,String>>
, org.refcodes.mixin.ValueAccessor.ValueMutator<String>
, org.refcodes.mixin.ValueAccessor.ValueProperty<String>
ResponseCookieImpl
public interface ResponseCookie extends Cookie, org.refcodes.mixin.PathAccessor.PathProperty, org.refcodes.mixin.PathAccessor.PathBuilder<ResponseCookie>, org.refcodes.mixin.DomainAccessor.DomainProperty, org.refcodes.mixin.DomainAccessor.DomainBuilder<ResponseCookie>
ResponseCookie
represents a builder for building response
cookies.
We use URL encoding / decoding for the cookie value (regarding
fromHttpCookie(String)
and toHttpCookie()
) to make life
easier and not fall into the trap of unescaped values.org.refcodes.mixin.DomainAccessor.DomainBuilder<B extends org.refcodes.mixin.DomainAccessor.DomainBuilder<?>>, org.refcodes.mixin.DomainAccessor.DomainMutator, org.refcodes.mixin.DomainAccessor.DomainProperty
org.refcodes.mixin.KeyAccessor.KeyBuilder<K extends Object,B extends org.refcodes.mixin.KeyAccessor.KeyBuilder<K,B>>, org.refcodes.mixin.KeyAccessor.KeyMutator<K extends Object>, org.refcodes.mixin.KeyAccessor.KeyProperty<K extends Object>
org.refcodes.mixin.PathAccessor.PathBuilder<B extends org.refcodes.mixin.PathAccessor.PathBuilder<?>>, org.refcodes.mixin.PathAccessor.PathMutator, org.refcodes.mixin.PathAccessor.PathProperty
org.refcodes.structure.Property.PropertyBuilder
org.refcodes.structure.Relation.RelationBuilder<K extends Object,V extends Object>
org.refcodes.mixin.ValueAccessor.ValueBuilder<V extends Object,B extends org.refcodes.mixin.ValueAccessor.ValueBuilder<V,B>>, org.refcodes.mixin.ValueAccessor.ValueMutator<V extends Object>, org.refcodes.mixin.ValueAccessor.ValueProperty<V extends Object>
Modifier and Type | Method | Description |
---|---|---|
default void |
fromHttpCookie(String aHttpCookie) |
Sets the cookie according to the provided HTTP cookie text.
|
Date |
getExpiresDate() |
Returns the expiration date of this
ResponseCookie . |
boolean |
isHttpOnly() |
Returns true if we have an HTTP only cookie.
|
boolean |
isSecure() |
Returns true if we have a secure HTTP cookie.
|
void |
setExpiresAfter(org.refcodes.time.TimeUnit aTimeUnit,
long aTime) |
Sets the expires date to the current time plus the provided time.
|
void |
setExpiresDate(Date aExpireDate) |
Sets the expiration date of this cookie.
|
void |
setHttpOnly(boolean isHttpOnly) |
Sets whether it be an HTTP only cookie.
|
void |
setSecure(boolean isSecure) |
Sets whether it be a secure HTTP cookie.
|
default String |
toHttpCookie() |
Returns the cookie to be assigned to a cookie Header-Field.
|
default ResponseCookie |
withDomain(String aDomain) |
Sets the domain for this cookie.
|
default ResponseCookie |
withExpiresAfter(org.refcodes.time.TimeUnit aTimeUnit,
long aTime) |
Builder method for the method
setExpiresAfter(TimeUnit, long) . |
default ResponseCookie |
withExpiresDate(Date aExpiresDate) |
Sets the expiration date of this cookie and returns this instance as of
the Builder-Pattern.
|
default ResponseCookie |
withHttpCookie(String aCookie) |
Sets the cookie according to the provided HTTP cookie text via
Cookie.fromHttpCookie(String) . |
default ResponseCookie |
withHttpOnly(boolean isHttpOnly) |
Sets whether it be an HTTP only cookie.
|
default ResponseCookie |
withPath(String aPath) |
Sets the path of the cookie.
|
default ResponseCookie |
withSecure(boolean isSecure) |
Sets whether it be a secure HTTP cookie.
|
void setExpiresAfter(org.refcodes.time.TimeUnit aTimeUnit, long aTime)
getExpiresDate()
to retrieve the resulting effective
Date
.aTimeUnit
- The TimeUnit
of the provided timeaTime
- The provided time after which to expiredefault ResponseCookie withExpiresAfter(org.refcodes.time.TimeUnit aTimeUnit, long aTime)
setExpiresAfter(TimeUnit, long)
.aTimeUnit
- The TimeUnit
of the provided timeaTime
- The provided time after which to expireResponseCookie
instance for further configuration.Date getExpiresDate()
ResponseCookie
.void setExpiresDate(Date aExpireDate)
aExpireDate
- The expiration date.default ResponseCookie withExpiresDate(Date aExpiresDate)
aExpiresDate
- the expires datedefault ResponseCookie withPath(String aPath)
withPath
in interface org.refcodes.mixin.PathAccessor.PathBuilder<ResponseCookie>
default ResponseCookie withDomain(String aDomain)
withDomain
in interface org.refcodes.mixin.DomainAccessor.DomainBuilder<ResponseCookie>
boolean isHttpOnly()
void setHttpOnly(boolean isHttpOnly)
isHttpOnly
- True in case of being an HTTP only cookie.default ResponseCookie withHttpOnly(boolean isHttpOnly)
isHttpOnly
- True in case of being an HTTP only cookie.boolean isSecure()
void setSecure(boolean isSecure)
isSecure
- True in case of being a secure only cookie.default ResponseCookie withSecure(boolean isSecure)
isSecure
- True in case of being a secure only cookie.default ResponseCookie withHttpCookie(String aCookie)
Cookie.fromHttpCookie(String)
.withHttpCookie
in interface Cookie
aCookie
- The HTTP cookie text.Cookie
instance as of the Builder-Pattern.default void fromHttpCookie(String aHttpCookie)
fromHttpCookie
in interface Cookie
aHttpCookie
- The HTTP cookie text.default String toHttpCookie()
toHttpCookie
in interface Cookie
Copyright © 2018. All rights reserved.