Interface ParserService


  • public interface ParserService
    The ParserService provides methods to serialize and deserialize OpenMUC records.
    • Method Detail

      • serialize

        byte[] serialize​(LoggingRecord openMucRecord)
                  throws SerializationException
        Serializes a given java datatype to byte array. The needed datatype depends on the concrete implementation of this service.
        Parameters:
        openMucRecord - logging record for serializing
        Returns:
        serialized record as byte array
        Throws:
        SerializationException - when something goes wrong while serializing
      • serialize

        byte[] serialize​(java.util.List<LoggingRecord> openMucRecords)
                  throws SerializationException
        Serializes a list of LogRecordContainers.
        Parameters:
        openMucRecords - list of logging records for serializing
        Returns:
        serialized records as byte array
        Throws:
        SerializationException - when something goes wrong while serializing
      • deserialize

        Record deserialize​(byte[] byteArray,
                           ValueType valueType)
        Deserializes a given JSON-String as byte array to Record. The format of the byte array depends on the concrete implementation of this service.
        Parameters:
        byteArray - received JSON-String
        valueType - defines the type of the value, which is encapsulated in the received JSON-String ValueType
        Returns:
        deserialized instance of Record