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

  public Message messages(int j) { return messages(new Message(), j); }
  public Message messages(Message obj, int j) { int o = __offset(4); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
  public int messagesLength() { int o = __offset(4); return o != 0 ? __vector_len(o) : 0; }
  public Profile profiles(int j) { return profiles(new Profile(), j); }
  public Profile profiles(Profile obj, int j) { int o = __offset(6); return o != 0 ? obj.__assign(__indirect(__vector(o) + j * 4), bb) : null; }
  public int profilesLength() { int o = __offset(6); return o != 0 ? __vector_len(o) : 0; }

  public static int createMessagingData(FlatBufferBuilder builder,
      int messagesOffset,
      int profilesOffset) {
    builder.startObject(2);
    MessagingData.addProfiles(builder, profilesOffset);
    MessagingData.addMessages(builder, messagesOffset);
    return MessagingData.endMessagingData(builder);
  }

  public static void startMessagingData(FlatBufferBuilder builder) { builder.startObject(2); }
  public static void addMessages(FlatBufferBuilder builder, int messagesOffset) { builder.addOffset(0, messagesOffset, 0); }
  public static int createMessagesVector(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 startMessagesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
  public static void addProfiles(FlatBufferBuilder builder, int profilesOffset) { builder.addOffset(1, profilesOffset, 0); }
  public static int createProfilesVector(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 startProfilesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
  public static int endMessagingData(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
}

