diffusion
Version:
Diffusion JavaScript client
56 lines (55 loc) • 2.74 kB
JavaScript
;
/**
* @module Services.TopicUpdate
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateUpdateStreamResponseSerialiser = exports.CreateUpdateStreamResponseSerialiserClass = void 0;
var Codec = require("./../../io/codec");
var serialiser_1 = require("./../../serialisers/serialiser");
var create_update_stream_response_1 = require("./create-update-stream-response");
var update_stream_id_serialiser_1 = require("./update-stream-id-serialiser");
/**
* Serialiser for {@link CreateUpdateStreamResponse}
*/
var CreateUpdateStreamResponseSerialiserClass = /** @class */ (function (_super) {
__extends(CreateUpdateStreamResponseSerialiserClass, _super);
function CreateUpdateStreamResponseSerialiserClass() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Read a {@link CreateUpdateStreamResponse} from the stream
*
* @param bis the input stream
* @return the {@link CreateUpdateStreamResponse} that was read
*/
CreateUpdateStreamResponseSerialiserClass.prototype.read = function (bis) {
var streamId = update_stream_id_serialiser_1.UpdateStreamIdSerialiser.read(bis);
var flags = Codec.readByte(bis);
// eslint-disable-next-line no-bitwise
var retainsValue = (flags & 1) > 0;
// eslint-disable-next-line no-bitwise
var supportsConflation = (flags & 2) > 0;
return new create_update_stream_response_1.CreateUpdateStreamResponse(streamId, retainsValue, supportsConflation);
};
return CreateUpdateStreamResponseSerialiserClass;
}(serialiser_1.AbstractSerialiser));
exports.CreateUpdateStreamResponseSerialiserClass = CreateUpdateStreamResponseSerialiserClass;
/**
* The {@link CreateUpdateStreamResponseSerialiser} singleton
*/ // eslint-disable-next-line @typescript-eslint/naming-convention
exports.CreateUpdateStreamResponseSerialiser = new CreateUpdateStreamResponseSerialiserClass();