Options
All
  • Public
  • Public/Protected
  • All
Menu

Defines the contract of the serializers used for Compact serialization.

After defining a serializer for the objects of the class C, it can be registered using the {@link ClientConfig.serialization.compact.serializers}.

write and read methods must be consistent with each other.

Type Parameters

  • C

Hierarchy

  • CompactSerializer

Index

Methods

  • getClass(): Function
  • You need to return the class constructor from this function. For example, if a class is instantiated with new Employee() class constructor is Employee. Alternatively, you can return a constructor function from this class. The function you provided will be used to check if an object is compact serializable.

    Returns Function

    The class or the constructor function which the serializer is written for.

  • getTypeName(): string
  • Type name is written into the serialized data and used while deserialization. This should have the same value with what other members of the cluster have. While deserializing there should be a matching serializer otherwise a GenericRecord will be returned.

    Returns string

    The type name of the registered class.

  • This method should construct a class instance and return it.

    throws

    HazelcastSerializationError in case of failure to read

    Parameters

    Returns C

    the class instance created as a result of read method.

  • This method should write a class instance's fields into writer.

    throws

    HazelcastSerializationError in case of failure to write

    Parameters

    • writer: CompactWriter

      CompactWriter to serialize the fields onto

    • instance: C

      class instance to be serialized.

    Returns void

Generated using TypeDoc