Class: VectorTimestampSerializer

VectorTimestampSerializer

This class can be used to serialize a list of VectorTimestamps into a string. The serialization can be customized using the format, separator, header, and footer params. The purpose of each of those is described below.

For example, if format="`HOST`:`CLOCK`", separator="," , header="[", footer="]", and the vector timestamps to serialize were "a {'a':1}" and "b {'b':1, 'a':1}", the resulting serialization would be "[a:{'a':1},b:{'b':1,'a':1}]"

Constructor

new VectorTimestampSerializer(format, separator, header, footer)

Constructs a new VectorTimestamp serializer with the specified format, separator, header and footer
Parameters:
Name Type Description
format String The format string describes how to serialize each vector timestamp. It can be any arbitrary string. For each vector timestamp, the substring in the format string equal to VectorTimestampSerializer.HOST_PLACEHOLDER will be replaced with the timestamp's host, and VectorTimestampSerializer.CLOCK_PLACEHOLDER will be replaced with the timestamp's clock.
separator String The separator string is placed in between each serialized vector timestamp.
header String The header string is prepended to the beginning of the rest of the serialization
footer String the footer string is appended to the end of the rest of the serialization
Source:

Members

(static, constant) CLOCK_PLACEHOLDER

Source:

(static, constant) HOST_PLACEHOLDER

Source:

Methods

serialize(The) → {String}

Serializes an array of vector timestamps. The timestamps will be serialized in the order they are found in the array.
Parameters:
Name Type Description
The Array.<VectorTimestamp> vector timestamps to serialize.
Source:
Returns:
The resulting serialization
Type
String