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

package optional_scalars;

import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;

@SuppressWarnings("unused")
public final class ScalarStuff extends Table {
  public static void ValidateVersion() { Constants.FLATBUFFERS_2_0_0(); }
  public static ScalarStuff getRootAsScalarStuff(ByteBuffer _bb) { return getRootAsScalarStuff(_bb, new ScalarStuff()); }
  public static ScalarStuff getRootAsScalarStuff(ByteBuffer _bb, ScalarStuff obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
  public static boolean ScalarStuffBufferHasIdentifier(ByteBuffer _bb) { return __has_identifier(_bb, "NULL"); }
  public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
  public ScalarStuff __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public byte justI8() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public boolean hasMaybeI8() { return 0 != __offset(6); }
  public byte maybeI8() { int o = __offset(6); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public byte defaultI8() { int o = __offset(8); return o != 0 ? bb.get(o + bb_pos) : 42; }
  public int justU8() { int o = __offset(10); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; }
  public boolean hasMaybeU8() { return 0 != __offset(12); }
  public int maybeU8() { int o = __offset(12); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 0; }
  public int defaultU8() { int o = __offset(14); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 42; }
  public short justI16() { int o = __offset(16); return o != 0 ? bb.getShort(o + bb_pos) : 0; }
  public boolean hasMaybeI16() { return 0 != __offset(18); }
  public short maybeI16() { int o = __offset(18); return o != 0 ? bb.getShort(o + bb_pos) : 0; }
  public short defaultI16() { int o = __offset(20); return o != 0 ? bb.getShort(o + bb_pos) : 42; }
  public int justU16() { int o = __offset(22); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
  public boolean hasMaybeU16() { return 0 != __offset(24); }
  public int maybeU16() { int o = __offset(24); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 0; }
  public int defaultU16() { int o = __offset(26); return o != 0 ? bb.getShort(o + bb_pos) & 0xFFFF : 42; }
  public int justI32() { int o = __offset(28); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
  public boolean hasMaybeI32() { return 0 != __offset(30); }
  public int maybeI32() { int o = __offset(30); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
  public int defaultI32() { int o = __offset(32); return o != 0 ? bb.getInt(o + bb_pos) : 42; }
  public long justU32() { int o = __offset(34); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 0L; }
  public boolean hasMaybeU32() { return 0 != __offset(36); }
  public long maybeU32() { int o = __offset(36); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 0L; }
  public long defaultU32() { int o = __offset(38); return o != 0 ? (long)bb.getInt(o + bb_pos) & 0xFFFFFFFFL : 42L; }
  public long justI64() { int o = __offset(40); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
  public boolean hasMaybeI64() { return 0 != __offset(42); }
  public long maybeI64() { int o = __offset(42); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
  public long defaultI64() { int o = __offset(44); return o != 0 ? bb.getLong(o + bb_pos) : 42L; }
  public long justU64() { int o = __offset(46); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
  public boolean hasMaybeU64() { return 0 != __offset(48); }
  public long maybeU64() { int o = __offset(48); return o != 0 ? bb.getLong(o + bb_pos) : 0L; }
  public long defaultU64() { int o = __offset(50); return o != 0 ? bb.getLong(o + bb_pos) : 42L; }
  public float justF32() { int o = __offset(52); return o != 0 ? bb.getFloat(o + bb_pos) : 0.0f; }
  public boolean hasMaybeF32() { return 0 != __offset(54); }
  public float maybeF32() { int o = __offset(54); return o != 0 ? bb.getFloat(o + bb_pos) : 0f; }
  public float defaultF32() { int o = __offset(56); return o != 0 ? bb.getFloat(o + bb_pos) : 42.0f; }
  public double justF64() { int o = __offset(58); return o != 0 ? bb.getDouble(o + bb_pos) : 0.0; }
  public boolean hasMaybeF64() { return 0 != __offset(60); }
  public double maybeF64() { int o = __offset(60); return o != 0 ? bb.getDouble(o + bb_pos) : 0.0; }
  public double defaultF64() { int o = __offset(62); return o != 0 ? bb.getDouble(o + bb_pos) : 42.0; }
  public boolean justBool() { int o = __offset(64); return o != 0 ? 0!=bb.get(o + bb_pos) : false; }
  public boolean hasMaybeBool() { return 0 != __offset(66); }
  public boolean maybeBool() { int o = __offset(66); return o != 0 ? 0!=bb.get(o + bb_pos) : false; }
  public boolean defaultBool() { int o = __offset(68); return o != 0 ? 0!=bb.get(o + bb_pos) : true; }
  public byte justEnum() { int o = __offset(70); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public boolean hasMaybeEnum() { return 0 != __offset(72); }
  public byte maybeEnum() { int o = __offset(72); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public byte defaultEnum() { int o = __offset(74); return o != 0 ? bb.get(o + bb_pos) : 1; }

  public static int createScalarStuff(FlatBufferBuilder builder,
      byte just_i8,
      byte maybe_i8,
      byte default_i8,
      int just_u8,
      int maybe_u8,
      int default_u8,
      short just_i16,
      short maybe_i16,
      short default_i16,
      int just_u16,
      int maybe_u16,
      int default_u16,
      int just_i32,
      int maybe_i32,
      int default_i32,
      long just_u32,
      long maybe_u32,
      long default_u32,
      long just_i64,
      long maybe_i64,
      long default_i64,
      long just_u64,
      long maybe_u64,
      long default_u64,
      float just_f32,
      float maybe_f32,
      float default_f32,
      double just_f64,
      double maybe_f64,
      double default_f64,
      boolean just_bool,
      boolean maybe_bool,
      boolean default_bool,
      byte just_enum,
      byte maybe_enum,
      byte default_enum) {
    builder.startTable(36);
    ScalarStuff.addDefaultF64(builder, default_f64);
    ScalarStuff.addMaybeF64(builder, maybe_f64);
    ScalarStuff.addJustF64(builder, just_f64);
    ScalarStuff.addDefaultU64(builder, default_u64);
    ScalarStuff.addMaybeU64(builder, maybe_u64);
    ScalarStuff.addJustU64(builder, just_u64);
    ScalarStuff.addDefaultI64(builder, default_i64);
    ScalarStuff.addMaybeI64(builder, maybe_i64);
    ScalarStuff.addJustI64(builder, just_i64);
    ScalarStuff.addDefaultF32(builder, default_f32);
    ScalarStuff.addMaybeF32(builder, maybe_f32);
    ScalarStuff.addJustF32(builder, just_f32);
    ScalarStuff.addDefaultU32(builder, default_u32);
    ScalarStuff.addMaybeU32(builder, maybe_u32);
    ScalarStuff.addJustU32(builder, just_u32);
    ScalarStuff.addDefaultI32(builder, default_i32);
    ScalarStuff.addMaybeI32(builder, maybe_i32);
    ScalarStuff.addJustI32(builder, just_i32);
    ScalarStuff.addDefaultU16(builder, default_u16);
    ScalarStuff.addMaybeU16(builder, maybe_u16);
    ScalarStuff.addJustU16(builder, just_u16);
    ScalarStuff.addDefaultI16(builder, default_i16);
    ScalarStuff.addMaybeI16(builder, maybe_i16);
    ScalarStuff.addJustI16(builder, just_i16);
    ScalarStuff.addDefaultEnum(builder, default_enum);
    ScalarStuff.addMaybeEnum(builder, maybe_enum);
    ScalarStuff.addJustEnum(builder, just_enum);
    ScalarStuff.addDefaultBool(builder, default_bool);
    ScalarStuff.addMaybeBool(builder, maybe_bool);
    ScalarStuff.addJustBool(builder, just_bool);
    ScalarStuff.addDefaultU8(builder, default_u8);
    ScalarStuff.addMaybeU8(builder, maybe_u8);
    ScalarStuff.addJustU8(builder, just_u8);
    ScalarStuff.addDefaultI8(builder, default_i8);
    ScalarStuff.addMaybeI8(builder, maybe_i8);
    ScalarStuff.addJustI8(builder, just_i8);
    return ScalarStuff.endScalarStuff(builder);
  }

  public static void startScalarStuff(FlatBufferBuilder builder) { builder.startTable(36); }
  public static void addJustI8(FlatBufferBuilder builder, byte justI8) { builder.addByte(0, justI8, 0); }
  public static void addMaybeI8(FlatBufferBuilder builder, byte maybeI8) { builder.addByte(1, maybeI8, 0); }
  public static void addDefaultI8(FlatBufferBuilder builder, byte defaultI8) { builder.addByte(2, defaultI8, 42); }
  public static void addJustU8(FlatBufferBuilder builder, int justU8) { builder.addByte(3, (byte)justU8, (byte)0); }
  public static void addMaybeU8(FlatBufferBuilder builder, int maybeU8) { builder.addByte(4, (byte)maybeU8, (byte)0); }
  public static void addDefaultU8(FlatBufferBuilder builder, int defaultU8) { builder.addByte(5, (byte)defaultU8, (byte)42); }
  public static void addJustI16(FlatBufferBuilder builder, short justI16) { builder.addShort(6, justI16, 0); }
  public static void addMaybeI16(FlatBufferBuilder builder, short maybeI16) { builder.addShort(7, maybeI16, 0); }
  public static void addDefaultI16(FlatBufferBuilder builder, short defaultI16) { builder.addShort(8, defaultI16, 42); }
  public static void addJustU16(FlatBufferBuilder builder, int justU16) { builder.addShort(9, (short)justU16, (short)0); }
  public static void addMaybeU16(FlatBufferBuilder builder, int maybeU16) { builder.addShort(10, (short)maybeU16, (short)0); }
  public static void addDefaultU16(FlatBufferBuilder builder, int defaultU16) { builder.addShort(11, (short)defaultU16, (short)42); }
  public static void addJustI32(FlatBufferBuilder builder, int justI32) { builder.addInt(12, justI32, 0); }
  public static void addMaybeI32(FlatBufferBuilder builder, int maybeI32) { builder.addInt(13, maybeI32, 0); }
  public static void addDefaultI32(FlatBufferBuilder builder, int defaultI32) { builder.addInt(14, defaultI32, 42); }
  public static void addJustU32(FlatBufferBuilder builder, long justU32) { builder.addInt(15, (int)justU32, (int)0L); }
  public static void addMaybeU32(FlatBufferBuilder builder, long maybeU32) { builder.addInt(16, (int)maybeU32, (int)0L); }
  public static void addDefaultU32(FlatBufferBuilder builder, long defaultU32) { builder.addInt(17, (int)defaultU32, (int)42L); }
  public static void addJustI64(FlatBufferBuilder builder, long justI64) { builder.addLong(18, justI64, 0L); }
  public static void addMaybeI64(FlatBufferBuilder builder, long maybeI64) { builder.addLong(19, maybeI64, 0L); }
  public static void addDefaultI64(FlatBufferBuilder builder, long defaultI64) { builder.addLong(20, defaultI64, 42L); }
  public static void addJustU64(FlatBufferBuilder builder, long justU64) { builder.addLong(21, justU64, 0L); }
  public static void addMaybeU64(FlatBufferBuilder builder, long maybeU64) { builder.addLong(22, maybeU64, 0L); }
  public static void addDefaultU64(FlatBufferBuilder builder, long defaultU64) { builder.addLong(23, defaultU64, 42L); }
  public static void addJustF32(FlatBufferBuilder builder, float justF32) { builder.addFloat(24, justF32, 0.0f); }
  public static void addMaybeF32(FlatBufferBuilder builder, float maybeF32) { builder.addFloat(25, maybeF32, 0f); }
  public static void addDefaultF32(FlatBufferBuilder builder, float defaultF32) { builder.addFloat(26, defaultF32, 42.0f); }
  public static void addJustF64(FlatBufferBuilder builder, double justF64) { builder.addDouble(27, justF64, 0.0); }
  public static void addMaybeF64(FlatBufferBuilder builder, double maybeF64) { builder.addDouble(28, maybeF64, 0.0); }
  public static void addDefaultF64(FlatBufferBuilder builder, double defaultF64) { builder.addDouble(29, defaultF64, 42.0); }
  public static void addJustBool(FlatBufferBuilder builder, boolean justBool) { builder.addBoolean(30, justBool, false); }
  public static void addMaybeBool(FlatBufferBuilder builder, boolean maybeBool) { builder.addBoolean(31, maybeBool, false); }
  public static void addDefaultBool(FlatBufferBuilder builder, boolean defaultBool) { builder.addBoolean(32, defaultBool, true); }
  public static void addJustEnum(FlatBufferBuilder builder, byte justEnum) { builder.addByte(33, justEnum, 0); }
  public static void addMaybeEnum(FlatBufferBuilder builder, byte maybeEnum) { builder.addByte(34, maybeEnum, 0); }
  public static void addDefaultEnum(FlatBufferBuilder builder, byte defaultEnum) { builder.addByte(35, defaultEnum, 1); }
  public static int endScalarStuff(FlatBufferBuilder builder) {
    int o = builder.endTable();
    return o;
  }
  public static void finishScalarStuffBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset, "NULL"); }
  public static void finishSizePrefixedScalarStuffBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset, "NULL"); }

  public static final class Vector extends BaseVector {
    public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }

    public ScalarStuff get(int j) { return get(new ScalarStuff(), j); }
    public ScalarStuff get(ScalarStuff obj, int j) {  return obj.__assign(__indirect(__element(j), bb), bb); }
  }
}

