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

package motis.intermodal;

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

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

  public byte startType() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public Table start(Table obj) { int o = __offset(6); return o != 0 ? __union(obj, o) : null; }
  public ModeWrapper startModes(int j) { return startModes(new ModeWrapper(), j); }
  public ModeWrapper startModes(ModeWrapper obj, int j) { int o = __offset(8); return o != 0 ? obj.__init(__indirect(__vector(o) + j * 4), bb) : null; }
  public int startModesLength() { int o = __offset(8); return o != 0 ? __vector_len(o) : 0; }
  public byte destinationType() { int o = __offset(10); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public Table destination(Table obj) { int o = __offset(12); return o != 0 ? __union(obj, o) : null; }
  public ModeWrapper destinationModes(int j) { return destinationModes(new ModeWrapper(), j); }
  public ModeWrapper destinationModes(ModeWrapper obj, int j) { int o = __offset(14); return o != 0 ? obj.__init(__indirect(__vector(o) + j * 4), bb) : null; }
  public int destinationModesLength() { int o = __offset(14); return o != 0 ? __vector_len(o) : 0; }
  public byte searchType() { int o = __offset(16); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public byte searchDir() { int o = __offset(18); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public String router() { int o = __offset(20); return o != 0 ? __string(o + bb_pos) : null; }
  public ByteBuffer routerAsByteBuffer() { return __vector_as_bytebuffer(20, 1); }

  public static int createIntermodalRoutingRequest(FlatBufferBuilder builder,
      byte start_type,
      int startOffset,
      int start_modesOffset,
      byte destination_type,
      int destinationOffset,
      int destination_modesOffset,
      byte search_type,
      byte search_dir,
      int routerOffset) {
    builder.startObject(9);
    IntermodalRoutingRequest.addRouter(builder, routerOffset);
    IntermodalRoutingRequest.addDestinationModes(builder, destination_modesOffset);
    IntermodalRoutingRequest.addDestination(builder, destinationOffset);
    IntermodalRoutingRequest.addStartModes(builder, start_modesOffset);
    IntermodalRoutingRequest.addStart(builder, startOffset);
    IntermodalRoutingRequest.addSearchDir(builder, search_dir);
    IntermodalRoutingRequest.addSearchType(builder, search_type);
    IntermodalRoutingRequest.addDestinationType(builder, destination_type);
    IntermodalRoutingRequest.addStartType(builder, start_type);
    return IntermodalRoutingRequest.endIntermodalRoutingRequest(builder);
  }

  public static void startIntermodalRoutingRequest(FlatBufferBuilder builder) { builder.startObject(9); }
  public static void addStartType(FlatBufferBuilder builder, byte startType) { builder.addByte(0, startType, 0); }
  public static void addStart(FlatBufferBuilder builder, int startOffset) { builder.addOffset(1, startOffset, 0); }
  public static void addStartModes(FlatBufferBuilder builder, int startModesOffset) { builder.addOffset(2, startModesOffset, 0); }
  public static int createStartModesVector(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 startStartModesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
  public static void addDestinationType(FlatBufferBuilder builder, byte destinationType) { builder.addByte(3, destinationType, 0); }
  public static void addDestination(FlatBufferBuilder builder, int destinationOffset) { builder.addOffset(4, destinationOffset, 0); }
  public static void addDestinationModes(FlatBufferBuilder builder, int destinationModesOffset) { builder.addOffset(5, destinationModesOffset, 0); }
  public static int createDestinationModesVector(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 startDestinationModesVector(FlatBufferBuilder builder, int numElems) { builder.startVector(4, numElems, 4); }
  public static void addSearchType(FlatBufferBuilder builder, byte searchType) { builder.addByte(6, searchType, 0); }
  public static void addSearchDir(FlatBufferBuilder builder, byte searchDir) { builder.addByte(7, searchDir, 0); }
  public static void addRouter(FlatBufferBuilder builder, int routerOffset) { builder.addOffset(8, routerOffset, 0); }
  public static int endIntermodalRoutingRequest(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
};

