// Code generated by the FlatBuffers compiler. DO NOT EDIT.

package report

import (
	flatbuffers "github.com/google/flatbuffers/go"
)

type RouteEntry struct {
	_tab flatbuffers.Table
}

func GetRootAsRouteEntry(buf []byte, offset flatbuffers.UOffsetT) *RouteEntry {
	n := flatbuffers.GetUOffsetT(buf[offset:])
	x := &RouteEntry{}
	x.Init(buf, n+offset)
	return x
}

func FinishRouteEntryBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
	builder.Finish(offset)
}

func GetSizePrefixedRootAsRouteEntry(buf []byte, offset flatbuffers.UOffsetT) *RouteEntry {
	n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
	x := &RouteEntry{}
	x.Init(buf, n+offset+flatbuffers.SizeUint32)
	return x
}

func FinishSizePrefixedRouteEntryBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
	builder.FinishSizePrefixed(offset)
}

func (rcv *RouteEntry) Init(buf []byte, i flatbuffers.UOffsetT) {
	rcv._tab.Bytes = buf
	rcv._tab.Pos = i
}

func (rcv *RouteEntry) Table() flatbuffers.Table {
	return rcv._tab
}

func (rcv *RouteEntry) Key() uint64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.GetUint64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *RouteEntry) MutateKey(n uint64) bool {
	return rcv._tab.MutateUint64Slot(4, n)
}

func (rcv *RouteEntry) Value() []byte {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.ByteVector(o + rcv._tab.Pos)
	}
	return nil
}

func RouteEntryStart(builder *flatbuffers.Builder) {
	builder.StartObject(2)
}
func RouteEntryAddKey(builder *flatbuffers.Builder, key uint64) {
	builder.PrependUint64Slot(0, key, 0)
}
func RouteEntryAddValue(builder *flatbuffers.Builder, value flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(value), 0)
}
func RouteEntryEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
