"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.LogT = exports.Log = void 0;
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
const flatbuffers = require("flatbuffers");
class Log {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsLog(bb, obj) {
        return (obj || new Log()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsLog(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new Log()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    data(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    static startLog(builder) {
        builder.startObject(1);
    }
    static addData(builder, dataOffset) {
        builder.addFieldOffset(0, dataOffset, 0);
    }
    static endLog(builder) {
        const offset = builder.endObject();
        builder.requiredField(offset, 4); // data
        return offset;
    }
    static createLog(builder, dataOffset) {
        Log.startLog(builder);
        Log.addData(builder, dataOffset);
        return Log.endLog(builder);
    }
    unpack() {
        return new LogT(this.data());
    }
    unpackTo(_o) {
        _o.data = this.data();
    }
}
exports.Log = Log;
class LogT {
    data;
    constructor(data = null) {
        this.data = data;
    }
    pack(builder) {
        const data = (this.data !== null ? builder.createString(this.data) : 0);
        return Log.createLog(builder, data);
    }
}
exports.LogT = LogT;
