• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// automatically generated by the FlatBuffers compiler, do not modify
2/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
3import * as flatbuffers from 'flatbuffers';
4import { OptionalByte } from '../optional-scalars/optional-byte';
5export class ScalarStuff {
6    constructor() {
7        this.bb = null;
8        this.bb_pos = 0;
9    }
10    __init(i, bb) {
11        this.bb_pos = i;
12        this.bb = bb;
13        return this;
14    }
15    static getRootAsScalarStuff(bb, obj) {
16        return (obj || new ScalarStuff()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
17    }
18    static getSizePrefixedRootAsScalarStuff(bb, obj) {
19        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
20        return (obj || new ScalarStuff()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21    }
22    static bufferHasIdentifier(bb) {
23        return bb.__has_identifier('NULL');
24    }
25    justI8() {
26        const offset = this.bb.__offset(this.bb_pos, 4);
27        return offset ? this.bb.readInt8(this.bb_pos + offset) : 0;
28    }
29    maybeI8() {
30        const offset = this.bb.__offset(this.bb_pos, 6);
31        return offset ? this.bb.readInt8(this.bb_pos + offset) : null;
32    }
33    defaultI8() {
34        const offset = this.bb.__offset(this.bb_pos, 8);
35        return offset ? this.bb.readInt8(this.bb_pos + offset) : 42;
36    }
37    justU8() {
38        const offset = this.bb.__offset(this.bb_pos, 10);
39        return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
40    }
41    maybeU8() {
42        const offset = this.bb.__offset(this.bb_pos, 12);
43        return offset ? this.bb.readUint8(this.bb_pos + offset) : null;
44    }
45    defaultU8() {
46        const offset = this.bb.__offset(this.bb_pos, 14);
47        return offset ? this.bb.readUint8(this.bb_pos + offset) : 42;
48    }
49    justI16() {
50        const offset = this.bb.__offset(this.bb_pos, 16);
51        return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
52    }
53    maybeI16() {
54        const offset = this.bb.__offset(this.bb_pos, 18);
55        return offset ? this.bb.readInt16(this.bb_pos + offset) : null;
56    }
57    defaultI16() {
58        const offset = this.bb.__offset(this.bb_pos, 20);
59        return offset ? this.bb.readInt16(this.bb_pos + offset) : 42;
60    }
61    justU16() {
62        const offset = this.bb.__offset(this.bb_pos, 22);
63        return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
64    }
65    maybeU16() {
66        const offset = this.bb.__offset(this.bb_pos, 24);
67        return offset ? this.bb.readUint16(this.bb_pos + offset) : null;
68    }
69    defaultU16() {
70        const offset = this.bb.__offset(this.bb_pos, 26);
71        return offset ? this.bb.readUint16(this.bb_pos + offset) : 42;
72    }
73    justI32() {
74        const offset = this.bb.__offset(this.bb_pos, 28);
75        return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
76    }
77    maybeI32() {
78        const offset = this.bb.__offset(this.bb_pos, 30);
79        return offset ? this.bb.readInt32(this.bb_pos + offset) : null;
80    }
81    defaultI32() {
82        const offset = this.bb.__offset(this.bb_pos, 32);
83        return offset ? this.bb.readInt32(this.bb_pos + offset) : 42;
84    }
85    justU32() {
86        const offset = this.bb.__offset(this.bb_pos, 34);
87        return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
88    }
89    maybeU32() {
90        const offset = this.bb.__offset(this.bb_pos, 36);
91        return offset ? this.bb.readUint32(this.bb_pos + offset) : null;
92    }
93    defaultU32() {
94        const offset = this.bb.__offset(this.bb_pos, 38);
95        return offset ? this.bb.readUint32(this.bb_pos + offset) : 42;
96    }
97    justI64() {
98        const offset = this.bb.__offset(this.bb_pos, 40);
99        return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('0');
100    }
101    maybeI64() {
102        const offset = this.bb.__offset(this.bb_pos, 42);
103        return offset ? this.bb.readInt64(this.bb_pos + offset) : null;
104    }
105    defaultI64() {
106        const offset = this.bb.__offset(this.bb_pos, 44);
107        return offset ? this.bb.readInt64(this.bb_pos + offset) : BigInt('42');
108    }
109    justU64() {
110        const offset = this.bb.__offset(this.bb_pos, 46);
111        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('0');
112    }
113    maybeU64() {
114        const offset = this.bb.__offset(this.bb_pos, 48);
115        return offset ? this.bb.readUint64(this.bb_pos + offset) : null;
116    }
117    defaultU64() {
118        const offset = this.bb.__offset(this.bb_pos, 50);
119        return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt('42');
120    }
121    justF32() {
122        const offset = this.bb.__offset(this.bb_pos, 52);
123        return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
124    }
125    maybeF32() {
126        const offset = this.bb.__offset(this.bb_pos, 54);
127        return offset ? this.bb.readFloat32(this.bb_pos + offset) : null;
128    }
129    defaultF32() {
130        const offset = this.bb.__offset(this.bb_pos, 56);
131        return offset ? this.bb.readFloat32(this.bb_pos + offset) : 42.0;
132    }
133    justF64() {
134        const offset = this.bb.__offset(this.bb_pos, 58);
135        return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
136    }
137    maybeF64() {
138        const offset = this.bb.__offset(this.bb_pos, 60);
139        return offset ? this.bb.readFloat64(this.bb_pos + offset) : null;
140    }
141    defaultF64() {
142        const offset = this.bb.__offset(this.bb_pos, 62);
143        return offset ? this.bb.readFloat64(this.bb_pos + offset) : 42.0;
144    }
145    justBool() {
146        const offset = this.bb.__offset(this.bb_pos, 64);
147        return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
148    }
149    maybeBool() {
150        const offset = this.bb.__offset(this.bb_pos, 66);
151        return offset ? !!this.bb.readInt8(this.bb_pos + offset) : null;
152    }
153    defaultBool() {
154        const offset = this.bb.__offset(this.bb_pos, 68);
155        return offset ? !!this.bb.readInt8(this.bb_pos + offset) : true;
156    }
157    justEnum() {
158        const offset = this.bb.__offset(this.bb_pos, 70);
159        return offset ? this.bb.readInt8(this.bb_pos + offset) : OptionalByte.None;
160    }
161    maybeEnum() {
162        const offset = this.bb.__offset(this.bb_pos, 72);
163        return offset ? this.bb.readInt8(this.bb_pos + offset) : null;
164    }
165    defaultEnum() {
166        const offset = this.bb.__offset(this.bb_pos, 74);
167        return offset ? this.bb.readInt8(this.bb_pos + offset) : OptionalByte.One;
168    }
169    static getFullyQualifiedName() {
170        return 'optional_scalars.ScalarStuff';
171    }
172    static startScalarStuff(builder) {
173        builder.startObject(36);
174    }
175    static addJustI8(builder, justI8) {
176        builder.addFieldInt8(0, justI8, 0);
177    }
178    static addMaybeI8(builder, maybeI8) {
179        builder.addFieldInt8(1, maybeI8, null);
180    }
181    static addDefaultI8(builder, defaultI8) {
182        builder.addFieldInt8(2, defaultI8, 42);
183    }
184    static addJustU8(builder, justU8) {
185        builder.addFieldInt8(3, justU8, 0);
186    }
187    static addMaybeU8(builder, maybeU8) {
188        builder.addFieldInt8(4, maybeU8, null);
189    }
190    static addDefaultU8(builder, defaultU8) {
191        builder.addFieldInt8(5, defaultU8, 42);
192    }
193    static addJustI16(builder, justI16) {
194        builder.addFieldInt16(6, justI16, 0);
195    }
196    static addMaybeI16(builder, maybeI16) {
197        builder.addFieldInt16(7, maybeI16, null);
198    }
199    static addDefaultI16(builder, defaultI16) {
200        builder.addFieldInt16(8, defaultI16, 42);
201    }
202    static addJustU16(builder, justU16) {
203        builder.addFieldInt16(9, justU16, 0);
204    }
205    static addMaybeU16(builder, maybeU16) {
206        builder.addFieldInt16(10, maybeU16, null);
207    }
208    static addDefaultU16(builder, defaultU16) {
209        builder.addFieldInt16(11, defaultU16, 42);
210    }
211    static addJustI32(builder, justI32) {
212        builder.addFieldInt32(12, justI32, 0);
213    }
214    static addMaybeI32(builder, maybeI32) {
215        builder.addFieldInt32(13, maybeI32, null);
216    }
217    static addDefaultI32(builder, defaultI32) {
218        builder.addFieldInt32(14, defaultI32, 42);
219    }
220    static addJustU32(builder, justU32) {
221        builder.addFieldInt32(15, justU32, 0);
222    }
223    static addMaybeU32(builder, maybeU32) {
224        builder.addFieldInt32(16, maybeU32, null);
225    }
226    static addDefaultU32(builder, defaultU32) {
227        builder.addFieldInt32(17, defaultU32, 42);
228    }
229    static addJustI64(builder, justI64) {
230        builder.addFieldInt64(18, justI64, BigInt('0'));
231    }
232    static addMaybeI64(builder, maybeI64) {
233        builder.addFieldInt64(19, maybeI64, null);
234    }
235    static addDefaultI64(builder, defaultI64) {
236        builder.addFieldInt64(20, defaultI64, BigInt('42'));
237    }
238    static addJustU64(builder, justU64) {
239        builder.addFieldInt64(21, justU64, BigInt('0'));
240    }
241    static addMaybeU64(builder, maybeU64) {
242        builder.addFieldInt64(22, maybeU64, null);
243    }
244    static addDefaultU64(builder, defaultU64) {
245        builder.addFieldInt64(23, defaultU64, BigInt('42'));
246    }
247    static addJustF32(builder, justF32) {
248        builder.addFieldFloat32(24, justF32, 0.0);
249    }
250    static addMaybeF32(builder, maybeF32) {
251        builder.addFieldFloat32(25, maybeF32, null);
252    }
253    static addDefaultF32(builder, defaultF32) {
254        builder.addFieldFloat32(26, defaultF32, 42.0);
255    }
256    static addJustF64(builder, justF64) {
257        builder.addFieldFloat64(27, justF64, 0.0);
258    }
259    static addMaybeF64(builder, maybeF64) {
260        builder.addFieldFloat64(28, maybeF64, null);
261    }
262    static addDefaultF64(builder, defaultF64) {
263        builder.addFieldFloat64(29, defaultF64, 42.0);
264    }
265    static addJustBool(builder, justBool) {
266        builder.addFieldInt8(30, +justBool, +false);
267    }
268    static addMaybeBool(builder, maybeBool) {
269        builder.addFieldInt8(31, +maybeBool, null);
270    }
271    static addDefaultBool(builder, defaultBool) {
272        builder.addFieldInt8(32, +defaultBool, +true);
273    }
274    static addJustEnum(builder, justEnum) {
275        builder.addFieldInt8(33, justEnum, OptionalByte.None);
276    }
277    static addMaybeEnum(builder, maybeEnum) {
278        builder.addFieldInt8(34, maybeEnum, null);
279    }
280    static addDefaultEnum(builder, defaultEnum) {
281        builder.addFieldInt8(35, defaultEnum, OptionalByte.One);
282    }
283    static endScalarStuff(builder) {
284        const offset = builder.endObject();
285        return offset;
286    }
287    static finishScalarStuffBuffer(builder, offset) {
288        builder.finish(offset, 'NULL');
289    }
290    static finishSizePrefixedScalarStuffBuffer(builder, offset) {
291        builder.finish(offset, 'NULL', true);
292    }
293    static createScalarStuff(builder, justI8, maybeI8, defaultI8, justU8, maybeU8, defaultU8, justI16, maybeI16, defaultI16, justU16, maybeU16, defaultU16, justI32, maybeI32, defaultI32, justU32, maybeU32, defaultU32, justI64, maybeI64, defaultI64, justU64, maybeU64, defaultU64, justF32, maybeF32, defaultF32, justF64, maybeF64, defaultF64, justBool, maybeBool, defaultBool, justEnum, maybeEnum, defaultEnum) {
294        ScalarStuff.startScalarStuff(builder);
295        ScalarStuff.addJustI8(builder, justI8);
296        if (maybeI8 !== null)
297            ScalarStuff.addMaybeI8(builder, maybeI8);
298        ScalarStuff.addDefaultI8(builder, defaultI8);
299        ScalarStuff.addJustU8(builder, justU8);
300        if (maybeU8 !== null)
301            ScalarStuff.addMaybeU8(builder, maybeU8);
302        ScalarStuff.addDefaultU8(builder, defaultU8);
303        ScalarStuff.addJustI16(builder, justI16);
304        if (maybeI16 !== null)
305            ScalarStuff.addMaybeI16(builder, maybeI16);
306        ScalarStuff.addDefaultI16(builder, defaultI16);
307        ScalarStuff.addJustU16(builder, justU16);
308        if (maybeU16 !== null)
309            ScalarStuff.addMaybeU16(builder, maybeU16);
310        ScalarStuff.addDefaultU16(builder, defaultU16);
311        ScalarStuff.addJustI32(builder, justI32);
312        if (maybeI32 !== null)
313            ScalarStuff.addMaybeI32(builder, maybeI32);
314        ScalarStuff.addDefaultI32(builder, defaultI32);
315        ScalarStuff.addJustU32(builder, justU32);
316        if (maybeU32 !== null)
317            ScalarStuff.addMaybeU32(builder, maybeU32);
318        ScalarStuff.addDefaultU32(builder, defaultU32);
319        ScalarStuff.addJustI64(builder, justI64);
320        if (maybeI64 !== null)
321            ScalarStuff.addMaybeI64(builder, maybeI64);
322        ScalarStuff.addDefaultI64(builder, defaultI64);
323        ScalarStuff.addJustU64(builder, justU64);
324        if (maybeU64 !== null)
325            ScalarStuff.addMaybeU64(builder, maybeU64);
326        ScalarStuff.addDefaultU64(builder, defaultU64);
327        ScalarStuff.addJustF32(builder, justF32);
328        if (maybeF32 !== null)
329            ScalarStuff.addMaybeF32(builder, maybeF32);
330        ScalarStuff.addDefaultF32(builder, defaultF32);
331        ScalarStuff.addJustF64(builder, justF64);
332        if (maybeF64 !== null)
333            ScalarStuff.addMaybeF64(builder, maybeF64);
334        ScalarStuff.addDefaultF64(builder, defaultF64);
335        ScalarStuff.addJustBool(builder, justBool);
336        if (maybeBool !== null)
337            ScalarStuff.addMaybeBool(builder, maybeBool);
338        ScalarStuff.addDefaultBool(builder, defaultBool);
339        ScalarStuff.addJustEnum(builder, justEnum);
340        if (maybeEnum !== null)
341            ScalarStuff.addMaybeEnum(builder, maybeEnum);
342        ScalarStuff.addDefaultEnum(builder, defaultEnum);
343        return ScalarStuff.endScalarStuff(builder);
344    }
345}
346