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

package lextwt

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

type Subject struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

func (rcv *Subject) Tag(obj *Tag) *Tag {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		x := rcv._tab.Indirect(o + rcv._tab.Pos)
		if obj == nil {
			obj = new(Tag)
		}
		obj.Init(rcv._tab.Bytes, x)
		return obj
	}
	return nil
}

func SubjectStart(builder *flatbuffers.Builder) {
	builder.StartObject(2)
}
func SubjectAddSubject(builder *flatbuffers.Builder, subject flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(subject), 0)
}
func SubjectAddTag(builder *flatbuffers.Builder, tag flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(tag), 0)
}
func SubjectEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
