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

  public String name() { int o = __offset(4); return o != 0 ? __string(o + bb_pos) : null; }
  public ByteBuffer nameAsByteBuffer() { return __vector_as_bytebuffer(4, 1); }
  public ByteBuffer nameInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 4, 1); }
  public Template layout() { return layout(new Template()); }
  public Template layout(Template obj) { int o = __offset(6); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
  public DataBinding dataBindings(int j) { return dataBindings(new DataBinding(), j); }
  public DataBinding dataBindings(DataBinding obj, int j) { int o = __offset(8); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
  public int dataBindingsLength() { int o = __offset(8); return o != 0 ? __vector_len(o) : 0; }

  public static int createTemplateRoot(FlatBufferBuilder builder,
      int nameOffset,
      int layoutOffset,
      int dataBindingsOffset) {
    builder.startObject(3);
    TemplateRoot.addDataBindings(builder, dataBindingsOffset);
    TemplateRoot.addLayout(builder, layoutOffset);
    TemplateRoot.addName(builder, nameOffset);
    return TemplateRoot.endTemplateRoot(builder);
  }

  public static void startTemplateRoot(FlatBufferBuilder builder) { builder.startObject(3); }
  public static void addName(FlatBufferBuilder builder, int nameOffset) { builder.addOffset(0, nameOffset, 0); }
  public static void addLayout(FlatBufferBuilder builder, int layoutOffset) { builder.addOffset(1, layoutOffset, 0); }
  public static void addDataBindings(FlatBufferBuilder builder, int dataBindingsOffset) { builder.addOffset(2, dataBindingsOffset, 0); }
  public static int createDataBindingsVector(FlatBufferBuilder builder, int[] data) { builder.startVector(4, data.length, 4); for (int i = data.length - 1; i >= 0; i--) builder.addOffset(data[i]); return builder.endVector(); }
  public static void startDataBindingsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
  public static int endTemplateRoot(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
}

