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

  public boolean reinstall() { int o = __offset(4); return o != 0 ? 0!=bb.get(o + bb_pos) : false; }
  public Id Id() { return Id(new Id()); }
  public Id Id(Id obj) { int o = __offset(6); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
  public int icon(int j) { int o = __offset(8); return o != 0 ? bb.get(__vector(o) + j * 1) & 0xFF : 0; }
  public int iconLength() { int o = __offset(8); return o != 0 ? __vector_len(o) : 0; }
  public ByteBuffer iconAsByteBuffer() { return __vector_as_bytebuffer(8, 1); }
  public ByteBuffer iconInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 8, 1); }
  public short requirements(int j) { int o = __offset(10); return o != 0 ? bb.getShort(__vector(o) + j * 2) : 0; }
  public int requirementsLength() { int o = __offset(10); return o != 0 ? __vector_len(o) : 0; }
  public ByteBuffer requirementsAsByteBuffer() { return __vector_as_bytebuffer(10, 2); }
  public ByteBuffer requirementsInByteBuffer(ByteBuffer _bb) { return __vector_in_bytebuffer(_bb, 10, 2); }
  public String voicePhrases(int j) { int o = __offset(12); return o != 0 ? __string(__vector(o) + j * 4) : null; }
  public int voicePhrasesLength() { int o = __offset(12); return o != 0 ? __vector_len(o) : 0; }
  public Widget widget() { return widget(new Widget()); }
  public Widget widget(Widget obj) { int o = __offset(14); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }

  public static int createApplication(FlatBufferBuilder builder,
      boolean reinstall,
      int IdOffset,
      int iconOffset,
      int requirementsOffset,
      int voicePhrasesOffset,
      int widgetOffset) {
    builder.startObject(6);
    Application.addWidget(builder, widgetOffset);
    Application.addVoicePhrases(builder, voicePhrasesOffset);
    Application.addRequirements(builder, requirementsOffset);
    Application.addIcon(builder, iconOffset);
    Application.addId(builder, IdOffset);
    Application.addReinstall(builder, reinstall);
    return Application.endApplication(builder);
  }

  public static void startApplication(FlatBufferBuilder builder) { builder.startObject(6); }
  public static void addReinstall(FlatBufferBuilder builder, boolean reinstall) { builder.addBoolean(0, reinstall, false); }
  public static void addId(FlatBufferBuilder builder, int IdOffset) { builder.addOffset(1, IdOffset, 0); }
  public static void addIcon(FlatBufferBuilder builder, int iconOffset) { builder.addOffset(2, iconOffset, 0); }
  public static int createIconVector(FlatBufferBuilder builder, byte[] data) { builder.startVector(1, data.length, 1); for (int i = data.length - 1; i >= 0; i--) builder.addByte(data[i]); return builder.endVector(); }
  public static void startIconVector(FlatBufferBuilder builder, int numElems) { builder.startVector(1, numElems, 1); }
  public static void addRequirements(FlatBufferBuilder builder, int requirementsOffset) { builder.addOffset(3, requirementsOffset, 0); }
  public static int createRequirementsVector(FlatBufferBuilder builder, short[] data) { builder.startVector(2, data.length, 2); for (int i = data.length - 1; i >= 0; i--) builder.addShort(data[i]); return builder.endVector(); }
  public static void startRequirementsVector(FlatBufferBuilder builder, int numElems) { builder.startVector(2, numElems, 2); }
  public static void addVoicePhrases(FlatBufferBuilder builder, int voicePhrasesOffset) { builder.addOffset(4, voicePhrasesOffset, 0); }
  public static int createVoicePhrasesVector(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 startVoicePhrasesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
  public static void addWidget(FlatBufferBuilder builder, int widgetOffset) { builder.addOffset(5, widgetOffset, 0); }
  public static int endApplication(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
}

