Package io.polywrap.core.msgpack
Class SerializationKt
-
- All Implemented Interfaces:
public final class SerializationKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static MsgPackmsgPackprivate final static KSerializer<Map<String, Object>>EnvSerializerprivate final static KSerializer<Map<String, Object>>NullableKVSerializer
-
Method Summary
Modifier and Type Method Description final MsgPackgetMsgPack()A lazily initialized MsgPack instance with a custom configuration. final KSerializer<Map<String, Object>>getEnvSerializer()MessagePack Serializer for Map<String, Any> final KSerializer<Map<String, Object>>getNullableKVSerializer()MessagePack Serializer for Map<String, Any?>? final static <T extends Any> ByteArraymsgPackEncode(T value)Encodes a given object into a msgpack byte array using the reified type's serializer. final static <T extends Any> ByteArraymsgPackEncode(SerializationStrategy<T> serializer, T value)Encodes a given object into a msgpack byte array using the provided serializer. final static <T extends Any> Result<T>msgPackDecode(ByteArray bytes)Decodes a given msgpack byte array into an object using the reified type's deserializer. final static <T extends Any> Result<T>msgPackDecode(DeserializationStrategy<T> serializer, ByteArray bytes)Decodes a given msgpack byte array into an object using the provided deserializer. -
-
Method Detail
-
getMsgPack
final MsgPack getMsgPack()
A lazily initialized MsgPack instance with a custom configuration.
-
getEnvSerializer
final KSerializer<Map<String, Object>> getEnvSerializer()
MessagePack Serializer for Map<String, Any>
-
getNullableKVSerializer
final KSerializer<Map<String, Object>> getNullableKVSerializer()
MessagePack Serializer for Map<String, Any?>?
-
msgPackEncode
final static <T extends Any> ByteArray msgPackEncode(T value)
Encodes a given object into a msgpack byte array using the reified type's serializer.
- Parameters:
value- the object to encode
-
msgPackEncode
final static <T extends Any> ByteArray msgPackEncode(SerializationStrategy<T> serializer, T value)
Encodes a given object into a msgpack byte array using the provided serializer.
- Parameters:
serializer- the serializer to use for encoding the objectvalue- the object to encode
-
msgPackDecode
final static <T extends Any> Result<T> msgPackDecode(ByteArray bytes)
Decodes a given msgpack byte array into an object using the reified type's deserializer.
- Parameters:
bytes- the msgpack byte array to decode
-
msgPackDecode
final static <T extends Any> Result<T> msgPackDecode(DeserializationStrategy<T> serializer, ByteArray bytes)
Decodes a given msgpack byte array into an object using the provided deserializer.
- Parameters:
serializer- the deserializer to use for decoding the objectbytes- the msgpack byte array to decode
-
-
-
-