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

package AllWatchSerialize;

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

@SuppressWarnings("unused")
public final class Command extends Table {
  public static Command getRootAsCommand(ByteBuffer _bb) { return getRootAsCommand(_bb, new Command()); }
  public static Command getRootAsCommand(ByteBuffer _bb, Command obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
  public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
  public Command __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public byte commandType() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public Table command(Table obj) { int o = __offset(6); return o != 0 ? __union(obj, o) : null; }
  public Id id() { return id(new Id()); }
  public Id id(Id obj) { int o = __offset(8); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }

  public static int createCommand(FlatBufferBuilder builder,
      byte command_type,
      int commandOffset,
      int idOffset) {
    builder.startObject(3);
    Command.addId(builder, idOffset);
    Command.addCommand(builder, commandOffset);
    Command.addCommandType(builder, command_type);
    return Command.endCommand(builder);
  }

  public static void startCommand(FlatBufferBuilder builder) { builder.startObject(3); }
  public static void addCommandType(FlatBufferBuilder builder, byte commandType) { builder.addByte(0, commandType, 0); }
  public static void addCommand(FlatBufferBuilder builder, int commandOffset) { builder.addOffset(1, commandOffset, 0); }
  public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addOffset(2, idOffset, 0); }
  public static int endCommand(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
  public static void finishCommandBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }
  public static void finishSizePrefixedCommandBuffer(FlatBufferBuilder builder, int offset) { builder.finishSizePrefixed(offset); }
}

