Class RequestCookie
java.lang.Object
org.refcodes.struct.RelationImpl<String,String>
org.refcodes.struct.PropertyImpl
org.refcodes.struct.PropertyImpl.PropertyBuilderImpl
org.refcodes.web.RequestCookie
- All Implemented Interfaces:
KeyAccessor<String>, KeyAccessor.KeyBuilder<String, Relation.RelationBuilder<String,String>>, KeyAccessor.KeyMutator<String>, KeyAccessor.KeyProperty<String>, ValueAccessor<String>, ValueAccessor.ValueBuilder<String, Relation.RelationBuilder<String, String>>, ValueAccessor.ValueMutator<String>, ValueAccessor.ValueProperty<String>, Property, Property.PropertyBuilder, Relation<String, String>, Relation.RelationBuilder<String, String>, Cookie
The
RequestCookie represents a request 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.-
Nested Class Summary
Nested classes/interfaces inherited from class PropertyImpl
PropertyImpl.PropertyBuilderImplNested classes/interfaces inherited from class RelationImpl
RelationImpl.RelationBuilderImpl<K,V> Nested classes/interfaces inherited from interface KeyAccessor
KeyAccessor.KeyBuilder<K,B>, KeyAccessor.KeyMutator<K>, KeyAccessor.KeyProperty<K> Nested classes/interfaces inherited from interface Property
Property.PropertyBuilderNested classes/interfaces inherited from interface Relation
Relation.RelationBuilder<K,V> Nested classes/interfaces inherited from interface ValueAccessor
ValueAccessor.ValueBuilder<V,B>, ValueAccessor.ValueMutator<V>, ValueAccessor.ValueProperty<V> -
Field Summary
Fields inherited from class RelationImpl
_key, _value -
Constructor Summary
ConstructorsConstructorDescriptionConstructs aRequestCookie.RequestCookie(String aHttpCookie) Constructs aRequestCookie.RequestCookie(String aCookieName, String aValue) Constructs aRequestCookiewith the given cookie name and value. -
Method Summary
Modifier and TypeMethodDescriptionvoidfromHttpCookie(String aHttpCookie) Sets the cookie according to the provided HTTP cookie text.Returns the cookie to be assigned to a cookie Header-Field.toString()withHttpCookie(String aCookie) Sets the cookie according to the provided HTTP cookie text viaCookie.fromHttpCookie(String).Methods inherited from class PropertyImpl.PropertyBuilderImpl
setKey, setValueMethods inherited from class RelationImpl
getKey, getValueMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface KeyAccessor
getKeyMethods inherited from interface KeyAccessor.KeyMutator
setKeyMethods inherited from interface KeyAccessor.KeyProperty
letKeyMethods inherited from interface Property
toPropertyMethods inherited from interface Property.PropertyBuilder
withKey, withValueMethods inherited from interface ValueAccessor
getValue, getValueOr, hasValueMethods inherited from interface ValueAccessor.ValueMutator
setValueMethods inherited from interface ValueAccessor.ValueProperty
letValue
-
Constructor Details
-
RequestCookie
public RequestCookie()Constructs aRequestCookie. -
RequestCookie
Constructs aRequestCookiewith the given cookie name and value.- Parameters:
aCookieName- The name of the cookie.aValue- The value for the cookie.
-
RequestCookie
Constructs aRequestCookie.- Parameters:
aHttpCookie- The text as being found in the according HTTP header field.
-
-
Method Details
-
withHttpCookie
Sets the cookie according to the provided HTTP cookie text viaCookie.fromHttpCookie(String).- Specified by:
withHttpCookiein interfaceCookie- Parameters:
aCookie- The HTTP cookie text.- Returns:
- A
Cookieinstance as of the Builder-Pattern.
-
fromHttpCookie
Sets the cookie according to the provided HTTP cookie text.- Specified by:
fromHttpCookiein interfaceCookie- Parameters:
aHttpCookie- The HTTP cookie text.
-
toHttpCookie
Returns the cookie to be assigned to a cookie Header-Field.- Specified by:
toHttpCookiein interfaceCookie- Returns:
- The cookie value for a Header-Field.
-
toString
- Overrides:
toStringin classPropertyImpl.PropertyBuilderImpl
-