xref: /aosp_15_r20/external/flatbuffers/tests/MyGame/Example/AnyAmbiguousAliasesUnion.java (revision 890232f25432b36107d06881e0a25aaa6b473652)
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 package MyGame.Example;
4 
5 import com.google.flatbuffers.FlatBufferBuilder;
6 
7 public class AnyAmbiguousAliasesUnion {
8   private byte type;
9   private Object value;
10 
getType()11   public byte getType() { return type; }
12 
setType(byte type)13   public void setType(byte type) { this.type = type; }
14 
getValue()15   public Object getValue() { return value; }
16 
setValue(Object value)17   public void setValue(Object value) { this.value = value; }
18 
AnyAmbiguousAliasesUnion()19   public AnyAmbiguousAliasesUnion() {
20     this.type = AnyAmbiguousAliases.NONE;
21     this.value = null;
22   }
23 
asM1()24   public MyGame.Example.MonsterT asM1() { return (MyGame.Example.MonsterT) value; }
asM2()25   public MyGame.Example.MonsterT asM2() { return (MyGame.Example.MonsterT) value; }
asM3()26   public MyGame.Example.MonsterT asM3() { return (MyGame.Example.MonsterT) value; }
27 
pack(FlatBufferBuilder builder, AnyAmbiguousAliasesUnion _o)28   public static int pack(FlatBufferBuilder builder, AnyAmbiguousAliasesUnion _o) {
29     switch (_o.type) {
30       case AnyAmbiguousAliases.M1: return MyGame.Example.Monster.pack(builder, _o.asM1());
31       case AnyAmbiguousAliases.M2: return MyGame.Example.Monster.pack(builder, _o.asM2());
32       case AnyAmbiguousAliases.M3: return MyGame.Example.Monster.pack(builder, _o.asM3());
33       default: return 0;
34     }
35   }
36 }
37 
38