// automatically generated by the FlatBuffers compiler, do not modify

/**
 * @const
 * @namespace
 */
var optional_scalars = optional_scalars || {};

/**
 * @enum {number}
 */
optional_scalars.OptionalByte = {
  None: 0,
  One: 1,
  Two: 2
};

/**
 * @enum {string}
 */
optional_scalars.OptionalByteName = {
  '0': 'None',
  '1': 'One',
  '2': 'Two'
};

/**
 * @constructor
 */
optional_scalars.ScalarStuff = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {optional_scalars.ScalarStuff}
 */
optional_scalars.ScalarStuff.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {optional_scalars.ScalarStuff=} obj
 * @returns {optional_scalars.ScalarStuff}
 */
optional_scalars.ScalarStuff.getRootAsScalarStuff = function(bb, obj) {
  return (obj || new optional_scalars.ScalarStuff).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {optional_scalars.ScalarStuff=} obj
 * @returns {optional_scalars.ScalarStuff}
 */
optional_scalars.ScalarStuff.getSizePrefixedRootAsScalarStuff = function(bb, obj) {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new optional_scalars.ScalarStuff).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {boolean}
 */
optional_scalars.ScalarStuff.bufferHasIdentifier = function(bb) {
  return bb.__has_identifier('NULL');
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.justI8 = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.readInt8(this.bb_pos + offset) : 0;
};

/**
 * @returns {number|null}
 */
optional_scalars.ScalarStuff.prototype.maybeI8 = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? this.bb.readInt8(this.bb_pos + offset) : null;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.defaultI8 = function() {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? this.bb.readInt8(this.bb_pos + offset) : 42;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.justU8 = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? this.bb.readUint8(this.bb_pos + offset) : 0;
};

/**
 * @returns {number|null}
 */
optional_scalars.ScalarStuff.prototype.maybeU8 = function() {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? this.bb.readUint8(this.bb_pos + offset) : null;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.defaultU8 = function() {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.readUint8(this.bb_pos + offset) : 42;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.justI16 = function() {
  var offset = this.bb.__offset(this.bb_pos, 16);
  return offset ? this.bb.readInt16(this.bb_pos + offset) : 0;
};

/**
 * @returns {number|null}
 */
optional_scalars.ScalarStuff.prototype.maybeI16 = function() {
  var offset = this.bb.__offset(this.bb_pos, 18);
  return offset ? this.bb.readInt16(this.bb_pos + offset) : null;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.defaultI16 = function() {
  var offset = this.bb.__offset(this.bb_pos, 20);
  return offset ? this.bb.readInt16(this.bb_pos + offset) : 42;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.justU16 = function() {
  var offset = this.bb.__offset(this.bb_pos, 22);
  return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
};

/**
 * @returns {number|null}
 */
optional_scalars.ScalarStuff.prototype.maybeU16 = function() {
  var offset = this.bb.__offset(this.bb_pos, 24);
  return offset ? this.bb.readUint16(this.bb_pos + offset) : null;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.defaultU16 = function() {
  var offset = this.bb.__offset(this.bb_pos, 26);
  return offset ? this.bb.readUint16(this.bb_pos + offset) : 42;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.justI32 = function() {
  var offset = this.bb.__offset(this.bb_pos, 28);
  return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
};

/**
 * @returns {number|null}
 */
optional_scalars.ScalarStuff.prototype.maybeI32 = function() {
  var offset = this.bb.__offset(this.bb_pos, 30);
  return offset ? this.bb.readInt32(this.bb_pos + offset) : null;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.defaultI32 = function() {
  var offset = this.bb.__offset(this.bb_pos, 32);
  return offset ? this.bb.readInt32(this.bb_pos + offset) : 42;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.justU32 = function() {
  var offset = this.bb.__offset(this.bb_pos, 34);
  return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
};

/**
 * @returns {number|null}
 */
optional_scalars.ScalarStuff.prototype.maybeU32 = function() {
  var offset = this.bb.__offset(this.bb_pos, 36);
  return offset ? this.bb.readUint32(this.bb_pos + offset) : null;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.defaultU32 = function() {
  var offset = this.bb.__offset(this.bb_pos, 38);
  return offset ? this.bb.readUint32(this.bb_pos + offset) : 42;
};

/**
 * @returns {flatbuffers.Long}
 */
optional_scalars.ScalarStuff.prototype.justI64 = function() {
  var offset = this.bb.__offset(this.bb_pos, 40);
  return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
};

/**
 * @returns {flatbuffers.Long|null}
 */
optional_scalars.ScalarStuff.prototype.maybeI64 = function() {
  var offset = this.bb.__offset(this.bb_pos, 42);
  return offset ? this.bb.readInt64(this.bb_pos + offset) : null;
};

/**
 * @returns {flatbuffers.Long}
 */
optional_scalars.ScalarStuff.prototype.defaultI64 = function() {
  var offset = this.bb.__offset(this.bb_pos, 44);
  return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(42, 0);
};

/**
 * @returns {flatbuffers.Long}
 */
optional_scalars.ScalarStuff.prototype.justU64 = function() {
  var offset = this.bb.__offset(this.bb_pos, 46);
  return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0);
};

/**
 * @returns {flatbuffers.Long|null}
 */
optional_scalars.ScalarStuff.prototype.maybeU64 = function() {
  var offset = this.bb.__offset(this.bb_pos, 48);
  return offset ? this.bb.readUint64(this.bb_pos + offset) : null;
};

/**
 * @returns {flatbuffers.Long}
 */
optional_scalars.ScalarStuff.prototype.defaultU64 = function() {
  var offset = this.bb.__offset(this.bb_pos, 50);
  return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(42, 0);
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.justF32 = function() {
  var offset = this.bb.__offset(this.bb_pos, 52);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : 0.0;
};

/**
 * @returns {number|null}
 */
optional_scalars.ScalarStuff.prototype.maybeF32 = function() {
  var offset = this.bb.__offset(this.bb_pos, 54);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : null;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.defaultF32 = function() {
  var offset = this.bb.__offset(this.bb_pos, 56);
  return offset ? this.bb.readFloat32(this.bb_pos + offset) : 42.0;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.justF64 = function() {
  var offset = this.bb.__offset(this.bb_pos, 58);
  return offset ? this.bb.readFloat64(this.bb_pos + offset) : 0.0;
};

/**
 * @returns {number|null}
 */
optional_scalars.ScalarStuff.prototype.maybeF64 = function() {
  var offset = this.bb.__offset(this.bb_pos, 60);
  return offset ? this.bb.readFloat64(this.bb_pos + offset) : null;
};

/**
 * @returns {number}
 */
optional_scalars.ScalarStuff.prototype.defaultF64 = function() {
  var offset = this.bb.__offset(this.bb_pos, 62);
  return offset ? this.bb.readFloat64(this.bb_pos + offset) : 42.0;
};

/**
 * @returns {boolean}
 */
optional_scalars.ScalarStuff.prototype.justBool = function() {
  var offset = this.bb.__offset(this.bb_pos, 64);
  return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
};

/**
 * @returns {boolean|null}
 */
optional_scalars.ScalarStuff.prototype.maybeBool = function() {
  var offset = this.bb.__offset(this.bb_pos, 66);
  return offset ? !!this.bb.readInt8(this.bb_pos + offset) : null;
};

/**
 * @returns {boolean}
 */
optional_scalars.ScalarStuff.prototype.defaultBool = function() {
  var offset = this.bb.__offset(this.bb_pos, 68);
  return offset ? !!this.bb.readInt8(this.bb_pos + offset) : true;
};

/**
 * @returns {optional_scalars.OptionalByte}
 */
optional_scalars.ScalarStuff.prototype.justEnum = function() {
  var offset = this.bb.__offset(this.bb_pos, 70);
  return offset ? /** @type {optional_scalars.OptionalByte} */ (this.bb.readInt8(this.bb_pos + offset)) : optional_scalars.OptionalByte.None;
};

/**
 * @returns {optional_scalars.OptionalByte|null}
 */
optional_scalars.ScalarStuff.prototype.maybeEnum = function() {
  var offset = this.bb.__offset(this.bb_pos, 72);
  return offset ? /** @type {optional_scalars.OptionalByte} */ (this.bb.readInt8(this.bb_pos + offset)) : null;
};

/**
 * @returns {optional_scalars.OptionalByte}
 */
optional_scalars.ScalarStuff.prototype.defaultEnum = function() {
  var offset = this.bb.__offset(this.bb_pos, 74);
  return offset ? /** @type {optional_scalars.OptionalByte} */ (this.bb.readInt8(this.bb_pos + offset)) : optional_scalars.OptionalByte.One;
};

/**
 * @param {flatbuffers.Builder} builder
 */
optional_scalars.ScalarStuff.startScalarStuff = function(builder) {
  builder.startObject(36);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} justI8
 */
optional_scalars.ScalarStuff.addJustI8 = function(builder, justI8) {
  builder.addFieldInt8(0, justI8, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} maybeI8
 */
optional_scalars.ScalarStuff.addMaybeI8 = function(builder, maybeI8) {
  builder.addFieldInt8(1, maybeI8, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} defaultI8
 */
optional_scalars.ScalarStuff.addDefaultI8 = function(builder, defaultI8) {
  builder.addFieldInt8(2, defaultI8, 42);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} justU8
 */
optional_scalars.ScalarStuff.addJustU8 = function(builder, justU8) {
  builder.addFieldInt8(3, justU8, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} maybeU8
 */
optional_scalars.ScalarStuff.addMaybeU8 = function(builder, maybeU8) {
  builder.addFieldInt8(4, maybeU8, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} defaultU8
 */
optional_scalars.ScalarStuff.addDefaultU8 = function(builder, defaultU8) {
  builder.addFieldInt8(5, defaultU8, 42);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} justI16
 */
optional_scalars.ScalarStuff.addJustI16 = function(builder, justI16) {
  builder.addFieldInt16(6, justI16, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} maybeI16
 */
optional_scalars.ScalarStuff.addMaybeI16 = function(builder, maybeI16) {
  builder.addFieldInt16(7, maybeI16, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} defaultI16
 */
optional_scalars.ScalarStuff.addDefaultI16 = function(builder, defaultI16) {
  builder.addFieldInt16(8, defaultI16, 42);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} justU16
 */
optional_scalars.ScalarStuff.addJustU16 = function(builder, justU16) {
  builder.addFieldInt16(9, justU16, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} maybeU16
 */
optional_scalars.ScalarStuff.addMaybeU16 = function(builder, maybeU16) {
  builder.addFieldInt16(10, maybeU16, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} defaultU16
 */
optional_scalars.ScalarStuff.addDefaultU16 = function(builder, defaultU16) {
  builder.addFieldInt16(11, defaultU16, 42);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} justI32
 */
optional_scalars.ScalarStuff.addJustI32 = function(builder, justI32) {
  builder.addFieldInt32(12, justI32, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} maybeI32
 */
optional_scalars.ScalarStuff.addMaybeI32 = function(builder, maybeI32) {
  builder.addFieldInt32(13, maybeI32, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} defaultI32
 */
optional_scalars.ScalarStuff.addDefaultI32 = function(builder, defaultI32) {
  builder.addFieldInt32(14, defaultI32, 42);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} justU32
 */
optional_scalars.ScalarStuff.addJustU32 = function(builder, justU32) {
  builder.addFieldInt32(15, justU32, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} maybeU32
 */
optional_scalars.ScalarStuff.addMaybeU32 = function(builder, maybeU32) {
  builder.addFieldInt32(16, maybeU32, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} defaultU32
 */
optional_scalars.ScalarStuff.addDefaultU32 = function(builder, defaultU32) {
  builder.addFieldInt32(17, defaultU32, 42);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Long} justI64
 */
optional_scalars.ScalarStuff.addJustI64 = function(builder, justI64) {
  builder.addFieldInt64(18, justI64, builder.createLong(0, 0));
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Long} maybeI64
 */
optional_scalars.ScalarStuff.addMaybeI64 = function(builder, maybeI64) {
  builder.addFieldInt64(19, maybeI64, builder.createLong(0, 0));
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Long} defaultI64
 */
optional_scalars.ScalarStuff.addDefaultI64 = function(builder, defaultI64) {
  builder.addFieldInt64(20, defaultI64, builder.createLong(42, 0));
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Long} justU64
 */
optional_scalars.ScalarStuff.addJustU64 = function(builder, justU64) {
  builder.addFieldInt64(21, justU64, builder.createLong(0, 0));
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Long} maybeU64
 */
optional_scalars.ScalarStuff.addMaybeU64 = function(builder, maybeU64) {
  builder.addFieldInt64(22, maybeU64, builder.createLong(0, 0));
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Long} defaultU64
 */
optional_scalars.ScalarStuff.addDefaultU64 = function(builder, defaultU64) {
  builder.addFieldInt64(23, defaultU64, builder.createLong(42, 0));
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} justF32
 */
optional_scalars.ScalarStuff.addJustF32 = function(builder, justF32) {
  builder.addFieldFloat32(24, justF32, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} maybeF32
 */
optional_scalars.ScalarStuff.addMaybeF32 = function(builder, maybeF32) {
  builder.addFieldFloat32(25, maybeF32, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} defaultF32
 */
optional_scalars.ScalarStuff.addDefaultF32 = function(builder, defaultF32) {
  builder.addFieldFloat32(26, defaultF32, 42.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} justF64
 */
optional_scalars.ScalarStuff.addJustF64 = function(builder, justF64) {
  builder.addFieldFloat64(27, justF64, 0.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} maybeF64
 */
optional_scalars.ScalarStuff.addMaybeF64 = function(builder, maybeF64) {
  builder.addFieldFloat64(28, maybeF64, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} defaultF64
 */
optional_scalars.ScalarStuff.addDefaultF64 = function(builder, defaultF64) {
  builder.addFieldFloat64(29, defaultF64, 42.0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {boolean} justBool
 */
optional_scalars.ScalarStuff.addJustBool = function(builder, justBool) {
  builder.addFieldInt8(30, +justBool, +false);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {boolean} maybeBool
 */
optional_scalars.ScalarStuff.addMaybeBool = function(builder, maybeBool) {
  builder.addFieldInt8(31, +maybeBool, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {boolean} defaultBool
 */
optional_scalars.ScalarStuff.addDefaultBool = function(builder, defaultBool) {
  builder.addFieldInt8(32, +defaultBool, +true);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {optional_scalars.OptionalByte} justEnum
 */
optional_scalars.ScalarStuff.addJustEnum = function(builder, justEnum) {
  builder.addFieldInt8(33, justEnum, optional_scalars.OptionalByte.None);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {optional_scalars.OptionalByte} maybeEnum
 */
optional_scalars.ScalarStuff.addMaybeEnum = function(builder, maybeEnum) {
  builder.addFieldInt8(34, maybeEnum, 0);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {optional_scalars.OptionalByte} defaultEnum
 */
optional_scalars.ScalarStuff.addDefaultEnum = function(builder, defaultEnum) {
  builder.addFieldInt8(35, defaultEnum, optional_scalars.OptionalByte.One);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
optional_scalars.ScalarStuff.endScalarStuff = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} offset
 */
optional_scalars.ScalarStuff.finishScalarStuffBuffer = function(builder, offset) {
  builder.finish(offset, 'NULL');
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} offset
 */
optional_scalars.ScalarStuff.finishSizePrefixedScalarStuffBuffer = function(builder, offset) {
  builder.finish(offset, 'NULL', true);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {number} justI8
 * @param {number|null} maybeI8
 * @param {number} defaultI8
 * @param {number} justU8
 * @param {number|null} maybeU8
 * @param {number} defaultU8
 * @param {number} justI16
 * @param {number|null} maybeI16
 * @param {number} defaultI16
 * @param {number} justU16
 * @param {number|null} maybeU16
 * @param {number} defaultU16
 * @param {number} justI32
 * @param {number|null} maybeI32
 * @param {number} defaultI32
 * @param {number} justU32
 * @param {number|null} maybeU32
 * @param {number} defaultU32
 * @param {flatbuffers.Long} justI64
 * @param {flatbuffers.Long|null} maybeI64
 * @param {flatbuffers.Long} defaultI64
 * @param {flatbuffers.Long} justU64
 * @param {flatbuffers.Long|null} maybeU64
 * @param {flatbuffers.Long} defaultU64
 * @param {number} justF32
 * @param {number|null} maybeF32
 * @param {number} defaultF32
 * @param {number} justF64
 * @param {number|null} maybeF64
 * @param {number} defaultF64
 * @param {boolean} justBool
 * @param {boolean|null} maybeBool
 * @param {boolean} defaultBool
 * @param {optional_scalars.OptionalByte} justEnum
 * @param {optional_scalars.OptionalByte|null} maybeEnum
 * @param {optional_scalars.OptionalByte} defaultEnum
 * @returns {flatbuffers.Offset}
 */
optional_scalars.ScalarStuff.createScalarStuff = function(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) {
  optional_scalars.ScalarStuff.startScalarStuff(builder);
  optional_scalars.ScalarStuff.addJustI8(builder, justI8);
  if (maybeI8 !== null)
    optional_scalars.ScalarStuff.addMaybeI8(builder, maybeI8);
  optional_scalars.ScalarStuff.addDefaultI8(builder, defaultI8);
  optional_scalars.ScalarStuff.addJustU8(builder, justU8);
  if (maybeU8 !== null)
    optional_scalars.ScalarStuff.addMaybeU8(builder, maybeU8);
  optional_scalars.ScalarStuff.addDefaultU8(builder, defaultU8);
  optional_scalars.ScalarStuff.addJustI16(builder, justI16);
  if (maybeI16 !== null)
    optional_scalars.ScalarStuff.addMaybeI16(builder, maybeI16);
  optional_scalars.ScalarStuff.addDefaultI16(builder, defaultI16);
  optional_scalars.ScalarStuff.addJustU16(builder, justU16);
  if (maybeU16 !== null)
    optional_scalars.ScalarStuff.addMaybeU16(builder, maybeU16);
  optional_scalars.ScalarStuff.addDefaultU16(builder, defaultU16);
  optional_scalars.ScalarStuff.addJustI32(builder, justI32);
  if (maybeI32 !== null)
    optional_scalars.ScalarStuff.addMaybeI32(builder, maybeI32);
  optional_scalars.ScalarStuff.addDefaultI32(builder, defaultI32);
  optional_scalars.ScalarStuff.addJustU32(builder, justU32);
  if (maybeU32 !== null)
    optional_scalars.ScalarStuff.addMaybeU32(builder, maybeU32);
  optional_scalars.ScalarStuff.addDefaultU32(builder, defaultU32);
  optional_scalars.ScalarStuff.addJustI64(builder, justI64);
  if (maybeI64 !== null)
    optional_scalars.ScalarStuff.addMaybeI64(builder, maybeI64);
  optional_scalars.ScalarStuff.addDefaultI64(builder, defaultI64);
  optional_scalars.ScalarStuff.addJustU64(builder, justU64);
  if (maybeU64 !== null)
    optional_scalars.ScalarStuff.addMaybeU64(builder, maybeU64);
  optional_scalars.ScalarStuff.addDefaultU64(builder, defaultU64);
  optional_scalars.ScalarStuff.addJustF32(builder, justF32);
  if (maybeF32 !== null)
    optional_scalars.ScalarStuff.addMaybeF32(builder, maybeF32);
  optional_scalars.ScalarStuff.addDefaultF32(builder, defaultF32);
  optional_scalars.ScalarStuff.addJustF64(builder, justF64);
  if (maybeF64 !== null)
    optional_scalars.ScalarStuff.addMaybeF64(builder, maybeF64);
  optional_scalars.ScalarStuff.addDefaultF64(builder, defaultF64);
  optional_scalars.ScalarStuff.addJustBool(builder, justBool);
  if (maybeBool !== null)
    optional_scalars.ScalarStuff.addMaybeBool(builder, maybeBool);
  optional_scalars.ScalarStuff.addDefaultBool(builder, defaultBool);
  optional_scalars.ScalarStuff.addJustEnum(builder, justEnum);
  if (maybeEnum !== null)
    optional_scalars.ScalarStuff.addMaybeEnum(builder, maybeEnum);
  optional_scalars.ScalarStuff.addDefaultEnum(builder, defaultEnum);
  return optional_scalars.ScalarStuff.endScalarStuff(builder);
}

// Exports for Node.js and RequireJS
this.optional_scalars = optional_scalars;
