eneter.messaging.nodes.channelwrapper
Class DataWrapper
java.lang.Object
eneter.messaging.nodes.channelwrapper.DataWrapper
public class DataWrapper
- extends java.lang.Object
Implements the wrapper/unwrapper of data.
Method Summary |
static WrappedData |
unwrap(java.lang.Object wrappedData,
ISerializer serializer)
Takes the serialized WrappedData and deserializes it with the given serializer. |
static java.lang.Object |
wrap(java.lang.Object addedData,
java.lang.Object originalData,
ISerializer serializer)
Adds the data to already serialized data. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DataWrapper
public DataWrapper()
wrap
public static java.lang.Object wrap(java.lang.Object addedData,
java.lang.Object originalData,
ISerializer serializer)
throws java.lang.Exception
- Adds the data to already serialized data.
It creates the WrappedData from the given data and serializes it with the provided serializer.
- Parameters:
addedData
- Added data. It must a basic .Net type. Otherwise the serialization will fail.originalData
- Already serialized data - it is type of string or byte[].serializer
- serializer
- Returns:
-
- Throws:
java.lang.Exception
unwrap
public static WrappedData unwrap(java.lang.Object wrappedData,
ISerializer serializer)
throws java.lang.Exception
- Takes the serialized WrappedData and deserializes it with the given serializer.
- Parameters:
wrappedData
- data serialized by 'Wrap' methodserializer
- serializer
- Returns:
- deserialized WrappedData
- Throws:
java.lang.Exception