xref: /aosp_15_r20/external/flatbuffers/tests/namespace_test/NamespaceA/NamespaceB/UnionInNestedNS.go (revision 890232f25432b36107d06881e0a25aaa6b473652)
1// Code generated by the FlatBuffers compiler. DO NOT EDIT.
2
3package NamespaceB
4
5import (
6	"strconv"
7
8	flatbuffers "github.com/google/flatbuffers/go"
9
10	NamespaceA__NamespaceB "NamespaceA/NamespaceB"
11)
12
13type UnionInNestedNST struct {
14	Type UnionInNestedNS
15	Value interface{}
16}
17
18func (t *UnionInNestedNST) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
19	if t == nil {
20		return 0
21	}
22	switch t.Type {
23	case UnionInNestedNSTableInNestedNS:
24		return t.Value.(*NamespaceA__NamespaceB.TableInNestedNST).Pack(builder)
25	}
26	return 0
27}
28
29func (rcv UnionInNestedNS) UnPack(table flatbuffers.Table) *UnionInNestedNST {
30	switch rcv {
31	case UnionInNestedNSTableInNestedNS:
32		x := TableInNestedNS{_tab: table}
33		return &NamespaceA__NamespaceB.UnionInNestedNST{ Type: UnionInNestedNSTableInNestedNS, Value: x.UnPack() }
34	}
35	return nil
36}
37