Package org.pkl.core.messaging
Class AbstractMessagePackDecoder
java.lang.Object
org.pkl.core.messaging.AbstractMessagePackDecoder
- All Implemented Interfaces:
MessageDecoder
- Direct Known Subclasses:
BaseMessagePackDecoder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode()decodeMessage(Message.Type msgType, Map<org.msgpack.value.Value, org.msgpack.value.Value> map) protected static org.msgpack.value.Valueprotected static @Nullable org.msgpack.value.ValuegetNullable(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) protected static booleanunpackBoolean(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) protected static byte @Nullable []unpackByteArray(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) protected static intunpackListOrNull(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key, Function<org.msgpack.value.Value, T> mapper) protected static longunpackLong(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) unpackLongOrNull(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) protected static <T> TunpackLongOrNull(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key, Function<Long, T> mapper) protected static StringunpackString(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) unpackStringListOrNull(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) unpackStringListOrNull(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key, Function<String, T> mapper) unpackStringMapOrNull(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) unpackStringMapOrNull(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key, Function<Map<org.msgpack.value.Value, org.msgpack.value.Value>, T> mapper) unpackStringOrNull(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) protected static <T> TunpackStringOrNull(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key, Function<String, T> mapper)
-
Field Details
-
unpacker
protected final org.msgpack.core.MessageUnpacker unpacker
-
-
Constructor Details
-
AbstractMessagePackDecoder
public AbstractMessagePackDecoder(org.msgpack.core.MessageUnpacker unpacker) -
AbstractMessagePackDecoder
-
-
Method Details
-
decodeMessage
@Nullable protected abstract @Nullable Message decodeMessage(Message.Type msgType, Map<org.msgpack.value.Value, org.msgpack.value.Value> map) throws DecodeException, URISyntaxException- Throws:
DecodeExceptionURISyntaxException
-
decode
- Specified by:
decodein interfaceMessageDecoder- Throws:
IOExceptionDecodeException
-
getNullable
-
get
protected static org.msgpack.value.Value get(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) throws DecodeException- Throws:
DecodeException
-
unpackString
protected static String unpackString(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) throws DecodeException- Throws:
DecodeException
-
unpackStringOrNull
-
unpackStringOrNull
-
unpackByteArray
-
unpackBoolean
protected static boolean unpackBoolean(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) throws DecodeException- Throws:
DecodeException
-
unpackInt
protected static int unpackInt(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) throws DecodeException- Throws:
DecodeException
-
unpackLong
protected static long unpackLong(Map<org.msgpack.value.Value, org.msgpack.value.Value> map, String key) throws DecodeException- Throws:
DecodeException
-
unpackLongOrNull
-
unpackLongOrNull
-
unpackStringListOrNull
-
unpackStringMapOrNull
-
unpackStringListOrNull
-
unpackListOrNull
-
unpackStringMapOrNull
-