Package org.jdrupes.httpcodec.types
Class SetCookieStringConverter
java.lang.Object
org.jdrupes.httpcodec.types.SetCookieStringConverter
- All Implemented Interfaces:
Converter<HttpCookie>
Converts a
HttpCookie to the representation used in
a “Set-Cookie” header.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasFieldValue(HttpCookie cookie) Returns the representation of this value in a header field.fromFieldValue(String text) Parses the given text and returns the parsed value.Returns the same site attribute.setSameSiteAttribute(Converters.SameSiteAttribute sameSiteAttribute) Controls if and which same site attribute is added to the string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jdrupes.httpcodec.types.Converter
asHeaderField
-
Constructor Details
-
SetCookieStringConverter
public SetCookieStringConverter()
-
-
Method Details
-
sameSiteAttribute
Returns the same site attribute.- Returns:
- the same site attribute
-
setSameSiteAttribute
public SetCookieStringConverter setSameSiteAttribute(Converters.SameSiteAttribute sameSiteAttribute) Controls if and which same site attribute is added to the string.- Parameters:
sameSiteAttribute- the new same site attribute
-
asFieldValue
Description copied from interface:ConverterReturns the representation of this value in a header field.- Specified by:
asFieldValuein interfaceConverter<HttpCookie>- Parameters:
cookie- the value to be converted- Returns:
- the representation
-
fromFieldValue
Description copied from interface:ConverterParses the given text and returns the parsed value.- Specified by:
fromFieldValuein interfaceConverter<HttpCookie>- Parameters:
text- the value from the header field- Returns:
- the parsed value
- Throws:
ParseException- if the value cannot be parsed
-