// 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 Component extends Table {
  public static Component getRootAsComponent(ByteBuffer _bb) { return getRootAsComponent(_bb, new Component()); }
  public static Component getRootAsComponent(ByteBuffer _bb, Component 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 Component __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public byte cmpType() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public Table cmp(Table obj) { int o = __offset(6); return o != 0 ? __union(obj, o) : null; }

  public static int createComponent(FlatBufferBuilder builder,
      byte cmp_type,
      int cmpOffset) {
    builder.startObject(2);
    Component.addCmp(builder, cmpOffset);
    Component.addCmpType(builder, cmp_type);
    return Component.endComponent(builder);
  }

  public static void startComponent(FlatBufferBuilder builder) { builder.startObject(2); }
  public static void addCmpType(FlatBufferBuilder builder, byte cmpType) { builder.addByte(0, cmpType, 0); }
  public static void addCmp(FlatBufferBuilder builder, int cmpOffset) { builder.addOffset(1, cmpOffset, 0); }
  public static int endComponent(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
}

