aboutsummaryrefslogtreecommitdiff
path: root/tests/golden_output/aidl-test-interface-java-source/gen/android/aidl/tests/ListOfInterfaces.java
blob: 6a2564ddc83b05542ee850cc27fae70e230016c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
/*
 * This file is auto-generated.  DO NOT MODIFY.
 */
package android.aidl.tests;
public class ListOfInterfaces implements android.os.Parcelable
{
  public static final android.os.Parcelable.Creator<ListOfInterfaces> CREATOR = new android.os.Parcelable.Creator<ListOfInterfaces>() {
    @Override
    public ListOfInterfaces createFromParcel(android.os.Parcel _aidl_source) {
      ListOfInterfaces _aidl_out = new ListOfInterfaces();
      _aidl_out.readFromParcel(_aidl_source);
      return _aidl_out;
    }
    @Override
    public ListOfInterfaces[] newArray(int _aidl_size) {
      return new ListOfInterfaces[_aidl_size];
    }
  };
  @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
  {
    int _aidl_start_pos = _aidl_parcel.dataPosition();
    _aidl_parcel.writeInt(0);
    int _aidl_end_pos = _aidl_parcel.dataPosition();
    _aidl_parcel.setDataPosition(_aidl_start_pos);
    _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
    _aidl_parcel.setDataPosition(_aidl_end_pos);
  }
  public final void readFromParcel(android.os.Parcel _aidl_parcel)
  {
    int _aidl_start_pos = _aidl_parcel.dataPosition();
    int _aidl_parcelable_size = _aidl_parcel.readInt();
    try {
      if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
    } finally {
      if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
        throw new android.os.BadParcelableException("Overflow in the size of parcelable");
      }
      _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
    }
  }
  @Override
  public int describeContents() {
    int _mask = 0;
    return _mask;
  }
  public interface IEmptyInterface extends android.os.IInterface
  {
    /** Default implementation for IEmptyInterface. */
    public static class Default implements android.aidl.tests.ListOfInterfaces.IEmptyInterface
    {
      @Override
      public android.os.IBinder asBinder() {
        return null;
      }
    }
    /** Local-side IPC implementation stub class. */
    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ListOfInterfaces.IEmptyInterface
    {
      /** Construct the stub at attach it to the interface. */
      public Stub()
      {
        this.attachInterface(this, DESCRIPTOR);
      }
      /**
       * Cast an IBinder object into an android.aidl.tests.ListOfInterfaces.IEmptyInterface interface,
       * generating a proxy if needed.
       */
      public static android.aidl.tests.ListOfInterfaces.IEmptyInterface asInterface(android.os.IBinder obj)
      {
        if ((obj==null)) {
          return null;
        }
        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
        if (((iin!=null)&&(iin instanceof android.aidl.tests.ListOfInterfaces.IEmptyInterface))) {
          return ((android.aidl.tests.ListOfInterfaces.IEmptyInterface)iin);
        }
        return new android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.Proxy(obj);
      }
      @Override public android.os.IBinder asBinder()
      {
        return this;
      }
      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
      {
        java.lang.String descriptor = DESCRIPTOR;
        switch (code)
        {
          case INTERFACE_TRANSACTION:
          {
            reply.writeString(descriptor);
            return true;
          }
        }
        switch (code)
        {
          default:
          {
            return super.onTransact(code, data, reply, flags);
          }
        }
      }
      private static class Proxy implements android.aidl.tests.ListOfInterfaces.IEmptyInterface
      {
        private android.os.IBinder mRemote;
        Proxy(android.os.IBinder remote)
        {
          mRemote = remote;
        }
        @Override public android.os.IBinder asBinder()
        {
          return mRemote;
        }
        public java.lang.String getInterfaceDescriptor()
        {
          return DESCRIPTOR;
        }
      }
    }
    public static final java.lang.String DESCRIPTOR = "android$aidl$tests$ListOfInterfaces$IEmptyInterface".replace('$', '.');
  }
  public interface IMyInterface extends android.os.IInterface
  {
    /** Default implementation for IMyInterface. */
    public static class Default implements android.aidl.tests.ListOfInterfaces.IMyInterface
    {
      @Override public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> methodWithInterfaces(android.aidl.tests.ListOfInterfaces.IEmptyInterface iface, android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_inout, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_inout) throws android.os.RemoteException
      {
        return null;
      }
      @Override
      public android.os.IBinder asBinder() {
        return null;
      }
    }
    /** Local-side IPC implementation stub class. */
    public static abstract class Stub extends android.os.Binder implements android.aidl.tests.ListOfInterfaces.IMyInterface
    {
      /** Construct the stub at attach it to the interface. */
      public Stub()
      {
        this.attachInterface(this, DESCRIPTOR);
      }
      /**
       * Cast an IBinder object into an android.aidl.tests.ListOfInterfaces.IMyInterface interface,
       * generating a proxy if needed.
       */
      public static android.aidl.tests.ListOfInterfaces.IMyInterface asInterface(android.os.IBinder obj)
      {
        if ((obj==null)) {
          return null;
        }
        android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
        if (((iin!=null)&&(iin instanceof android.aidl.tests.ListOfInterfaces.IMyInterface))) {
          return ((android.aidl.tests.ListOfInterfaces.IMyInterface)iin);
        }
        return new android.aidl.tests.ListOfInterfaces.IMyInterface.Stub.Proxy(obj);
      }
      @Override public android.os.IBinder asBinder()
      {
        return this;
      }
      @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
      {
        java.lang.String descriptor = DESCRIPTOR;
        if (code >= android.os.IBinder.FIRST_CALL_TRANSACTION && code <= android.os.IBinder.LAST_CALL_TRANSACTION) {
          data.enforceInterface(descriptor);
        }
        switch (code)
        {
          case INTERFACE_TRANSACTION:
          {
            reply.writeString(descriptor);
            return true;
          }
        }
        switch (code)
        {
          case TRANSACTION_methodWithInterfaces:
          {
            android.aidl.tests.ListOfInterfaces.IEmptyInterface _arg0;
            _arg0 = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(data.readStrongBinder());
            android.aidl.tests.ListOfInterfaces.IEmptyInterface _arg1;
            _arg1 = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(data.readStrongBinder());
            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg2;
            _arg2 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg3;
            _arg3 = new java.util.ArrayList<android.aidl.tests.ListOfInterfaces.IEmptyInterface>();
            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg4;
            _arg4 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg5;
            _arg5 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg6;
            _arg6 = new java.util.ArrayList<android.aidl.tests.ListOfInterfaces.IEmptyInterface>();
            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _arg7;
            _arg7 = data.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
            data.enforceNoDataAvail();
            java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _result = this.methodWithInterfaces(_arg0, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7);
            reply.writeNoException();
            reply.writeInterfaceList(_result);
            reply.writeInterfaceList(_arg3);
            reply.writeInterfaceList(_arg4);
            reply.writeInterfaceList(_arg6);
            reply.writeInterfaceList(_arg7);
            break;
          }
          default:
          {
            return super.onTransact(code, data, reply, flags);
          }
        }
        return true;
      }
      private static class Proxy implements android.aidl.tests.ListOfInterfaces.IMyInterface
      {
        private android.os.IBinder mRemote;
        Proxy(android.os.IBinder remote)
        {
          mRemote = remote;
        }
        @Override public android.os.IBinder asBinder()
        {
          return mRemote;
        }
        public java.lang.String getInterfaceDescriptor()
        {
          return DESCRIPTOR;
        }
        @Override public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> methodWithInterfaces(android.aidl.tests.ListOfInterfaces.IEmptyInterface iface, android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_inout, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_inout) throws android.os.RemoteException
        {
          android.os.Parcel _data = android.os.Parcel.obtain(asBinder());
          android.os.Parcel _reply = android.os.Parcel.obtain();
          java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _result;
          try {
            _data.writeInterfaceToken(DESCRIPTOR);
            _data.writeStrongInterface(iface);
            _data.writeStrongInterface(nullable_iface);
            _data.writeInterfaceList(iface_list_in);
            _data.writeInterfaceList(iface_list_inout);
            _data.writeInterfaceList(nullable_iface_list_in);
            _data.writeInterfaceList(nullable_iface_list_inout);
            boolean _status = mRemote.transact(Stub.TRANSACTION_methodWithInterfaces, _data, _reply, 0);
            _reply.readException();
            _result = _reply.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
            _reply.readInterfaceList(iface_list_out, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
            _reply.readInterfaceList(iface_list_inout, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
            _reply.readInterfaceList(nullable_iface_list_out, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
            _reply.readInterfaceList(nullable_iface_list_inout, android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
          }
          finally {
            _reply.recycle();
            _data.recycle();
          }
          return _result;
        }
      }
      static final int TRANSACTION_methodWithInterfaces = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
    }
    public static final java.lang.String DESCRIPTOR = "android$aidl$tests$ListOfInterfaces$IMyInterface".replace('$', '.');
    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> methodWithInterfaces(android.aidl.tests.ListOfInterfaces.IEmptyInterface iface, android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list_inout, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_in, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_out, java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list_inout) throws android.os.RemoteException;
  }
  public static class MyParcelable implements android.os.Parcelable
  {
    public android.aidl.tests.ListOfInterfaces.IEmptyInterface iface;
    public android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface;
    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list;
    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list;
    public static final android.os.Parcelable.Creator<MyParcelable> CREATOR = new android.os.Parcelable.Creator<MyParcelable>() {
      @Override
      public MyParcelable createFromParcel(android.os.Parcel _aidl_source) {
        MyParcelable _aidl_out = new MyParcelable();
        _aidl_out.readFromParcel(_aidl_source);
        return _aidl_out;
      }
      @Override
      public MyParcelable[] newArray(int _aidl_size) {
        return new MyParcelable[_aidl_size];
      }
    };
    @Override public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag)
    {
      int _aidl_start_pos = _aidl_parcel.dataPosition();
      _aidl_parcel.writeInt(0);
      _aidl_parcel.writeStrongInterface(iface);
      _aidl_parcel.writeStrongInterface(nullable_iface);
      _aidl_parcel.writeInterfaceList(iface_list);
      _aidl_parcel.writeInterfaceList(nullable_iface_list);
      int _aidl_end_pos = _aidl_parcel.dataPosition();
      _aidl_parcel.setDataPosition(_aidl_start_pos);
      _aidl_parcel.writeInt(_aidl_end_pos - _aidl_start_pos);
      _aidl_parcel.setDataPosition(_aidl_end_pos);
    }
    public final void readFromParcel(android.os.Parcel _aidl_parcel)
    {
      int _aidl_start_pos = _aidl_parcel.dataPosition();
      int _aidl_parcelable_size = _aidl_parcel.readInt();
      try {
        if (_aidl_parcelable_size < 4) throw new android.os.BadParcelableException("Parcelable too small");;
        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
        iface = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
        nullable_iface = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
        iface_list = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
        if (_aidl_parcel.dataPosition() - _aidl_start_pos >= _aidl_parcelable_size) return;
        nullable_iface_list = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
      } finally {
        if (_aidl_start_pos > (Integer.MAX_VALUE - _aidl_parcelable_size)) {
          throw new android.os.BadParcelableException("Overflow in the size of parcelable");
        }
        _aidl_parcel.setDataPosition(_aidl_start_pos + _aidl_parcelable_size);
      }
    }
    @Override
    public String toString() {
      java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "{", "}");
      _aidl_sj.add("iface: " + (java.util.Objects.toString(iface)));
      _aidl_sj.add("nullable_iface: " + (java.util.Objects.toString(nullable_iface)));
      _aidl_sj.add("iface_list: " + (java.util.Objects.toString(iface_list)));
      _aidl_sj.add("nullable_iface_list: " + (java.util.Objects.toString(nullable_iface_list)));
      return "android.aidl.tests.ListOfInterfaces.MyParcelable" + _aidl_sj.toString()  ;
    }
    @Override
    public boolean equals(Object other) {
      if (this == other) return true;
      if (other == null) return false;
      if (!(other instanceof MyParcelable)) return false;
      MyParcelable that = (MyParcelable)other;
      if (!java.util.Objects.deepEquals(iface, that.iface)) return false;
      if (!java.util.Objects.deepEquals(nullable_iface, that.nullable_iface)) return false;
      if (!java.util.Objects.deepEquals(iface_list, that.iface_list)) return false;
      if (!java.util.Objects.deepEquals(nullable_iface_list, that.nullable_iface_list)) return false;
      return true;
    }

    @Override
    public int hashCode() {
      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(iface, nullable_iface, iface_list, nullable_iface_list).toArray());
    }
    @Override
    public int describeContents() {
      int _mask = 0;
      return _mask;
    }
  }
  public static final class MyUnion implements android.os.Parcelable {
    // tags for union fields
    public final static int iface = 0;  // android.aidl.tests.ListOfInterfaces.IEmptyInterface iface;
    public final static int nullable_iface = 1;  // android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface;
    public final static int iface_list = 2;  // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list;
    public final static int nullable_iface_list = 3;  // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list;

    private int _tag;
    private Object _value;

    public MyUnion() {
      android.aidl.tests.ListOfInterfaces.IEmptyInterface _value = null;
      this._tag = iface;
      this._value = _value;
    }

    private MyUnion(android.os.Parcel _aidl_parcel) {
      readFromParcel(_aidl_parcel);
    }

    private MyUnion(int _tag, Object _value) {
      this._tag = _tag;
      this._value = _value;
    }

    public int getTag() {
      return _tag;
    }

    // android.aidl.tests.ListOfInterfaces.IEmptyInterface iface;

    public static MyUnion iface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
      return new MyUnion(iface, _value);
    }

    public android.aidl.tests.ListOfInterfaces.IEmptyInterface getIface() {
      _assertTag(iface);
      return (android.aidl.tests.ListOfInterfaces.IEmptyInterface) _value;
    }

    public void setIface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
      _set(iface, _value);
    }

    // android.aidl.tests.ListOfInterfaces.IEmptyInterface nullable_iface;

    public static MyUnion nullable_iface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
      return new MyUnion(nullable_iface, _value);
    }

    public android.aidl.tests.ListOfInterfaces.IEmptyInterface getNullable_iface() {
      _assertTag(nullable_iface);
      return (android.aidl.tests.ListOfInterfaces.IEmptyInterface) _value;
    }

    public void setNullable_iface(android.aidl.tests.ListOfInterfaces.IEmptyInterface _value) {
      _set(nullable_iface, _value);
    }

    // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> iface_list;

    public static MyUnion iface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
      return new MyUnion(iface_list, _value);
    }

    @SuppressWarnings("unchecked")
    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> getIface_list() {
      _assertTag(iface_list);
      return (java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface>) _value;
    }

    public void setIface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
      _set(iface_list, _value);
    }

    // List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> nullable_iface_list;

    public static MyUnion nullable_iface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
      return new MyUnion(nullable_iface_list, _value);
    }

    @SuppressWarnings("unchecked")
    public java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> getNullable_iface_list() {
      _assertTag(nullable_iface_list);
      return (java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface>) _value;
    }

    public void setNullable_iface_list(java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _value) {
      _set(nullable_iface_list, _value);
    }

    public static final android.os.Parcelable.Creator<MyUnion> CREATOR = new android.os.Parcelable.Creator<MyUnion>() {
      @Override
      public MyUnion createFromParcel(android.os.Parcel _aidl_source) {
        return new MyUnion(_aidl_source);
      }
      @Override
      public MyUnion[] newArray(int _aidl_size) {
        return new MyUnion[_aidl_size];
      }
    };

    @Override
    public final void writeToParcel(android.os.Parcel _aidl_parcel, int _aidl_flag) {
      _aidl_parcel.writeInt(_tag);
      switch (_tag) {
      case iface:
        _aidl_parcel.writeStrongInterface(getIface());
        break;
      case nullable_iface:
        _aidl_parcel.writeStrongInterface(getNullable_iface());
        break;
      case iface_list:
        _aidl_parcel.writeInterfaceList(getIface_list());
        break;
      case nullable_iface_list:
        _aidl_parcel.writeInterfaceList(getNullable_iface_list());
        break;
      }
    }

    public void readFromParcel(android.os.Parcel _aidl_parcel) {
      int _aidl_tag;
      _aidl_tag = _aidl_parcel.readInt();
      switch (_aidl_tag) {
      case iface: {
        android.aidl.tests.ListOfInterfaces.IEmptyInterface _aidl_value;
        _aidl_value = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
        _set(_aidl_tag, _aidl_value);
        return; }
      case nullable_iface: {
        android.aidl.tests.ListOfInterfaces.IEmptyInterface _aidl_value;
        _aidl_value = android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub.asInterface(_aidl_parcel.readStrongBinder());
        _set(_aidl_tag, _aidl_value);
        return; }
      case iface_list: {
        java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _aidl_value;
        _aidl_value = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
        _set(_aidl_tag, _aidl_value);
        return; }
      case nullable_iface_list: {
        java.util.List<android.aidl.tests.ListOfInterfaces.IEmptyInterface> _aidl_value;
        _aidl_value = _aidl_parcel.createInterfaceArrayList(android.aidl.tests.ListOfInterfaces.IEmptyInterface.Stub::asInterface);
        _set(_aidl_tag, _aidl_value);
        return; }
      }
      throw new IllegalArgumentException("union: unknown tag: " + _aidl_tag);
    }

    @Override
    public int describeContents() {
      int _mask = 0;
      switch (getTag()) {
      }
      return _mask;
    }

    @Override
    public String toString() {
      switch (_tag) {
      case iface: return "android.aidl.tests.ListOfInterfaces.MyUnion.iface(" + (java.util.Objects.toString(getIface())) + ")";
      case nullable_iface: return "android.aidl.tests.ListOfInterfaces.MyUnion.nullable_iface(" + (java.util.Objects.toString(getNullable_iface())) + ")";
      case iface_list: return "android.aidl.tests.ListOfInterfaces.MyUnion.iface_list(" + (java.util.Objects.toString(getIface_list())) + ")";
      case nullable_iface_list: return "android.aidl.tests.ListOfInterfaces.MyUnion.nullable_iface_list(" + (java.util.Objects.toString(getNullable_iface_list())) + ")";
      }
      throw new IllegalStateException("unknown field: " + _tag);
    }
    @Override
    public boolean equals(Object other) {
      if (this == other) return true;
      if (other == null) return false;
      if (!(other instanceof MyUnion)) return false;
      MyUnion that = (MyUnion)other;
      if (_tag != that._tag) return false;
      if (!java.util.Objects.deepEquals(_value, that._value)) return false;
      return true;
    }

    @Override
    public int hashCode() {
      return java.util.Arrays.deepHashCode(java.util.Arrays.asList(_tag, _value).toArray());
    }

    private void _assertTag(int tag) {
      if (getTag() != tag) {
        throw new IllegalStateException("bad access: " + _tagString(tag) + ", " + _tagString(getTag()) + " is available.");
      }
    }

    private String _tagString(int _tag) {
      switch (_tag) {
      case iface: return "iface";
      case nullable_iface: return "nullable_iface";
      case iface_list: return "iface_list";
      case nullable_iface_list: return "nullable_iface_list";
      }
      throw new IllegalStateException("unknown field: " + _tag);
    }

    private void _set(int _tag, Object _value) {
      this._tag = _tag;
      this._value = _value;
    }
    public static @interface Tag {
      public static final int iface = 0;
      public static final int nullable_iface = 1;
      public static final int iface_list = 2;
      public static final int nullable_iface_list = 3;
    }
  }
}