Class ReportScriptFunctionsPyDictionaryProtoAdapter
java.lang.Object
com.inductiveautomation.reporting.common.rpc.ReportScriptFunctionsPyDictionaryProtoAdapter
- All Implemented Interfaces:
BinaryAdapter<org.python.core.PyDictionary>
,BinaryDeserializer<org.python.core.PyDictionary>
,BinarySerializer<org.python.core.PyDictionary>
public class ReportScriptFunctionsPyDictionaryProtoAdapter
extends Object
implements BinaryAdapter<org.python.core.PyDictionary>
Adapter for PyDictionary to be serialized and deserialized by the ProtoSerializer. Currently, all keys and values are
java serialized. We might want to change this in the future to whitelist certain types, to reduce usage of java
serialization.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.python.core.PyDictionary
decode
(byte[] bytes, DeserializationContext context) byte[]
encode
(org.python.core.PyDictionary any, SerializationContext context)
-
Constructor Details
-
ReportScriptFunctionsPyDictionaryProtoAdapter
public ReportScriptFunctionsPyDictionaryProtoAdapter()
-
-
Method Details
-
encode
public byte[] encode(org.python.core.PyDictionary any, SerializationContext context) throws ProtoSerializationException - Specified by:
encode
in interfaceBinarySerializer<org.python.core.PyDictionary>
- Throws:
ProtoSerializationException
-
decode
public org.python.core.PyDictionary decode(byte[] bytes, DeserializationContext context) throws ProtoSerializationException - Specified by:
decode
in interfaceBinaryDeserializer<org.python.core.PyDictionary>
- Throws:
ProtoSerializationException
-