"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.PortRangeT = exports.PortRange = 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 PortRange {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsPortRange(bb, obj) {
        return (obj || new PortRange()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsPortRange(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new PortRange()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    min() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
    }
    max() {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
    }
    static startPortRange(builder) {
        builder.startObject(2);
    }
    static addMin(builder, min) {
        builder.addFieldInt16(0, min, 0);
    }
    static addMax(builder, max) {
        builder.addFieldInt16(1, max, 0);
    }
    static endPortRange(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createPortRange(builder, min, max) {
        PortRange.startPortRange(builder);
        PortRange.addMin(builder, min);
        PortRange.addMax(builder, max);
        return PortRange.endPortRange(builder);
    }
    unpack() {
        return new PortRangeT(this.min(), this.max());
    }
    unpackTo(_o) {
        _o.min = this.min();
        _o.max = this.max();
    }
}
exports.PortRange = PortRange;
class PortRangeT {
    min;
    max;
    constructor(min = 0, max = 0) {
        this.min = min;
        this.max = max;
    }
    pack(builder) {
        return PortRange.createPortRange(builder, this.min, this.max);
    }
}
exports.PortRangeT = PortRangeT;
