pt.unl.fct.di.novasys.babel.crdts.generic

Interface GenericCRDT

    • Method Detail

      • getType

        CRDTsTypes getType()
        Gets the CRDT type
        Returns:
        the CRDT type
      • copy

        GenericCRDT copy()
        Creates a copy of the CRDT. Modifications on the copy don't modify the original.
        Returns:
        a copy of the CRDT
      • serialize

        void serialize(io.netty.buffer.ByteBuf in)
                throws IOException
        Serializes the CRDT into a ByteBuf
        Parameters:
        in - ByteBuf to serialize the CRDT to
        Throws:
        IOException - if an error occurs while serializing
      • deserializeDataType

        static GenericCRDT deserializeDataType(CRDTsTypes crdtType,
                                               io.netty.buffer.ByteBuf in)
                                        throws IOException
        A static method that deserializes a GenericCRDT by receiving its concrete CRDT type as an argument. The concrete serializer of the object is used based on the dataType passed into the method
        Parameters:
        crdtType - data type of the object
        in - ByteBuf where the object is stored
        Returns:
        the serialized object as a SerializableType
        Throws:
        IOException - if there is an error parsing the object

Copyright © 2024. All rights reserved.