// automatically generated by the FlatBuffers compiler, do not modify
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any,
 * @typescript-eslint/no-non-null-assertion */
import * as flatbuffers from 'flatbuffers';
export class A {
  constructor() {
    this.bb = null;
    this.bb_pos = 0;
  }
  __init(i, bb) {
    this.bb_pos = i;
    this.bb = bb;
    return this;
  }
  static getRootAsA(bb, obj) {
    return (obj || new A())
        .__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  static getSizePrefixedRootAsA(bb, obj) {
    bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
    return (obj || new A())
        .__init(bb.readInt32(bb.position()) + bb.position(), bb);
  }
  a() {
    const offset = this.bb.__offset(this.bb_pos, 4);
    return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
  }
  mutate_a(value) {
    const offset = this.bb.__offset(this.bb_pos, 4);
    if (offset === 0) {
      return false;
    }
    this.bb.writeInt32(this.bb_pos + offset, value);
    return true;
  }
  static getFullyQualifiedName() {
    return 'UnionUnderlyingType.A';
  }
  static startA(builder) {
    builder.startObject(1);
  }
  static addA(builder, a) {
    builder.addFieldInt32(0, a, 0);
  }
  static endA(builder) {
    const offset = builder.endObject();
    return offset;
  }
  static createA(builder, a) {
    A.startA(builder);
    A.addA(builder, a);
    return A.endA(builder);
  }
  unpack() {
    return new AT(this.a());
  }
  unpackTo(_o) {
    _o.a = this.a();
  }
}
export class AT {
  constructor(a = 0) {
    this.a = a;
  }
  pack(builder) {
    return A.createA(builder, this.a);
  }
}
