Enum Class ValueTransformation
- All Implemented Interfaces:
Serializable,Comparable<ValueTransformation>,Constable
The type of transformation to be applied to a cookie's value(s) when reading or writing it.
To write a cookie with a transformation applied to its value, use
ResponseCookies.add(StandardResponseCookie, ValueTransformation).
To read a cookie with a transformation applied to its raw value, use
RequestCookies.getFirst(String, ValueTransformation) or
RequestCookies.getSingleOrError(String, ValueTransformation).
- Since:
- 2.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueTransformationReturns the enum constant of this class with the specified name.static ValueTransformation[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
The cookie value is not transformed in any way. This is appropriate only for non-sensitive cookies which the client can set and modify. -
ENCRYPT
The cookie value is encrypted by the server. The client cannot read the value of such cookies, or change that in any way.If an encrypted cookie's value is tampered with or an
ExpirableResponseCookieexpires, theRequestCookiescontainer methods to access the cookie will return null as if the cookie did not exist. -
SIGN
The cookie value is signed by the server. The client cannot read the value of such cookies, or change that in any way unless it is also capable of signing the cookie using the same key and algorithm as the server.If a signed cookie's value is tampered with, the
RequestCookiescontainer methods to access the cookie will return null as if the cookie did not exist.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-