Package org.pac4j.core.util.serializer
Interface Serializer
- All Known Implementing Classes:
AbstractSerializer
,JavaSerializer
,JsonSerializer
public interface Serializer
The serializer contract.
- Since:
- 3.9.0
- Author:
- Jerome LELEU
-
Method Summary
Modifier and TypeMethodDescriptiondeserializeFromBytes
(byte[] encoded) Decode a bytes array into an object.deserializeFromString
(String encoded) Decode a string into an object.byte[]
serializeToBytes
(Object obj) Encode an object into a bytes array.serializeToString
(Object obj) Encode an object into a string.
-
Method Details
-
serializeToString
Encode an object into a string.- Parameters:
obj
- the object to encode- Returns:
- the encoded string
-
serializeToBytes
Encode an object into a bytes array.- Parameters:
obj
- the object to encode- Returns:
- the encoded bytes array
-
deserializeFromString
Decode a string into an object.- Parameters:
encoded
- the encoded string- Returns:
- the decoded object
-
deserializeFromBytes
Decode a bytes array into an object.- Parameters:
encoded
- the encoded bytes array- Returns:
- the decoded object
-