Interface PhenopacketFormatConverter<T extends com.google.protobuf.MessageOrBuilder>
- Type Parameters:
T
-
public interface PhenopacketFormatConverter<T extends com.google.protobuf.MessageOrBuilder>
The implementors allow to convert between formats of the top-level elements of Phenopacket schema.
-
Method Summary
Modifier and TypeMethodDescriptiontoItem
(byte[] payload) Convert thepayload
into Protobuf representation of a top-level element.Convert JSONpayload
into Protobuf representation of a top-level element.default String
toJson
(byte[] payload) Convert thepayload
into a JSON string.Convert Protobuf representation of a top-level element into a JSON string.
-
Method Details
-
toItem
Convert thepayload
into Protobuf representation of a top-level element.- Throws:
ConversionException
- in case the conversion fails.
-
toItem
Convert JSONpayload
into Protobuf representation of a top-level element.- Throws:
ConversionException
- in case the conversion fails.
-
toJson
Convert Protobuf representation of a top-level element into a JSON string. -
toJson
Convert thepayload
into a JSON string.- Throws:
ConversionException
- if the conversion fails.
-