• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// automatically generated by the FlatBuffers compiler, do not modify
2
3/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
4
5import * as flatbuffers from 'flatbuffers';
6
7
8
9export class KeyValue implements flatbuffers.IUnpackableObject<KeyValueT> {
10  bb: flatbuffers.ByteBuffer|null = null;
11  bb_pos = 0;
12  __init(i:number, bb:flatbuffers.ByteBuffer):KeyValue {
13  this.bb_pos = i;
14  this.bb = bb;
15  return this;
16}
17
18static getRootAsKeyValue(bb:flatbuffers.ByteBuffer, obj?:KeyValue):KeyValue {
19  return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
20}
21
22static getSizePrefixedRootAsKeyValue(bb:flatbuffers.ByteBuffer, obj?:KeyValue):KeyValue {
23  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
24  return (obj || new KeyValue()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
25}
26
27key():string|null
28key(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
29key(optionalEncoding?:any):string|Uint8Array|null {
30  const offset = this.bb!.__offset(this.bb_pos, 4);
31  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
32}
33
34value():string|null
35value(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
36value(optionalEncoding?:any):string|Uint8Array|null {
37  const offset = this.bb!.__offset(this.bb_pos, 6);
38  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
39}
40
41static getFullyQualifiedName():string {
42  return 'reflection.KeyValue';
43}
44
45static startKeyValue(builder:flatbuffers.Builder) {
46  builder.startObject(2);
47}
48
49static addKey(builder:flatbuffers.Builder, keyOffset:flatbuffers.Offset) {
50  builder.addFieldOffset(0, keyOffset, 0);
51}
52
53static addValue(builder:flatbuffers.Builder, valueOffset:flatbuffers.Offset) {
54  builder.addFieldOffset(1, valueOffset, 0);
55}
56
57static endKeyValue(builder:flatbuffers.Builder):flatbuffers.Offset {
58  const offset = builder.endObject();
59  builder.requiredField(offset, 4) // key
60  return offset;
61}
62
63static createKeyValue(builder:flatbuffers.Builder, keyOffset:flatbuffers.Offset, valueOffset:flatbuffers.Offset):flatbuffers.Offset {
64  KeyValue.startKeyValue(builder);
65  KeyValue.addKey(builder, keyOffset);
66  KeyValue.addValue(builder, valueOffset);
67  return KeyValue.endKeyValue(builder);
68}
69
70unpack(): KeyValueT {
71  return new KeyValueT(
72    this.key(),
73    this.value()
74  );
75}
76
77
78unpackTo(_o: KeyValueT): void {
79  _o.key = this.key();
80  _o.value = this.value();
81}
82}
83
84export class KeyValueT implements flatbuffers.IGeneratedObject {
85constructor(
86  public key: string|Uint8Array|null = null,
87  public value: string|Uint8Array|null = null
88){}
89
90
91pack(builder:flatbuffers.Builder): flatbuffers.Offset {
92  const key = (this.key !== null ? builder.createString(this.key!) : 0);
93  const value = (this.value !== null ? builder.createString(this.value!) : 0);
94
95  return KeyValue.createKeyValue(builder,
96    key,
97    value
98  );
99}
100}
101