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

Enum CRDTsTypes

  • All Implemented Interfaces:
    Serializable, Comparable<CRDTsTypes>


    public enum CRDTsTypes
    extends Enum<CRDTsTypes>
    CRDT types implemented in this library. The types are divided into three main categories - delta, state and operation based - which are identified by the trailing character.
    • Field Detail

      • serializer

        public static pt.unl.fct.di.novasys.network.ISerializer<CRDTsTypes> serializer
        Static method to serialize (and deserialize) and arbitrary CRDType object.
    • Method Detail

      • values

        public static CRDTsTypes[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CRDTsTypes c : CRDTsTypes.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CRDTsTypes valueOf(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getType

        public String getType()
      • isOfFlavor

        public boolean isOfFlavor(CRDTsTypes.FLAVOR flavor)
        Checks if the CRDT is of a specific type
        Parameters:
        flavor - flavor of CRDT
        Returns:
        true if it is, or false otherwise
      • toCRDLWWTType

        public static CRDTsTypes toCRDLWWTType(CRDTsTypes.FLAVOR flavor,
                                               pt.unl.fct.di.novasys.babel.protocols.storage.utils.types.ReplicatedStructuresOperations.ReplicatedDataTypes type)
      • createLWWCRDT

        public static GenericCRDT createLWWCRDT(CRDTsTypes.FLAVOR flavor,
                                                pt.unl.fct.di.novasys.babel.protocols.storage.utils.types.ReplicatedStructuresOperations.ReplicatedDataTypes type,
                                                VVState state,
                                                Object initialValue)
      • toCausalCRDType

        public static CRDTsTypes toCausalCRDType(CRDTsTypes.FLAVOR flavor,
                                                 pt.unl.fct.di.novasys.babel.protocols.storage.utils.types.ReplicatedStructuresOperations.ReplicatedDataTypes type)

Copyright © 2024. All rights reserved.