public class OxmSerializer extends Object implements InitializingBean, RedisSerializer<Object>
Marshaller
and Unmarshaller
. Note:Null objects are serialized as empty arrays and vice versa.Constructor and Description |
---|
OxmSerializer() |
OxmSerializer(Marshaller marshaller,
Unmarshaller unmarshaller) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
Object |
deserialize(byte[] bytes)
Deserialize an object from the given binary data.
|
byte[] |
serialize(Object t)
Serialize the given object to binary data.
|
void |
setMarshaller(Marshaller marshaller) |
void |
setUnmarshaller(Unmarshaller unmarshaller) |
public OxmSerializer()
public OxmSerializer(Marshaller marshaller, Unmarshaller unmarshaller)
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public void setMarshaller(Marshaller marshaller)
marshaller
- The marshaller to set.public void setUnmarshaller(Unmarshaller unmarshaller)
unmarshaller
- The unmarshaller to set.public Object deserialize(byte[] bytes) throws SerializationException
RedisSerializer
deserialize
in interface RedisSerializer<Object>
bytes
- object binary representationSerializationException
public byte[] serialize(Object t) throws SerializationException
RedisSerializer
serialize
in interface RedisSerializer<Object>
t
- object to serializeSerializationException
Copyright © 2011-2015–2016 Pivotal Software, Inc.. All rights reserved.