• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is auto-generated.  DO NOT MODIFY.
3  */
4 package android.aidl.tests;
5 public @interface IntEnum {
6   public static final int FOO = 1000;
7   public static final int BAR = 2000;
8   public static final int BAZ = 2001;
9   /** @deprecated do not use this */
10   @Deprecated
11   public static final int QUX = 2002;
12   interface $ {
toString(int _aidl_v)13     static String toString(int _aidl_v) {
14       if (_aidl_v == FOO) return "FOO";
15       if (_aidl_v == BAR) return "BAR";
16       if (_aidl_v == BAZ) return "BAZ";
17       if (_aidl_v == QUX) return "QUX";
18       return Integer.toString(_aidl_v);
19     }
arrayToString(Object _aidl_v)20     static String arrayToString(Object _aidl_v) {
21       if (_aidl_v == null) return "null";
22       Class<?> _aidl_cls = _aidl_v.getClass();
23       if (!_aidl_cls.isArray()) throw new IllegalArgumentException("not an array: " + _aidl_v);
24       Class<?> comp = _aidl_cls.getComponentType();
25       java.util.StringJoiner _aidl_sj = new java.util.StringJoiner(", ", "[", "]");
26       if (comp.isArray()) {
27         for (int _aidl_i = 0; _aidl_i < java.lang.reflect.Array.getLength(_aidl_v); _aidl_i++) {
28           _aidl_sj.add(arrayToString(java.lang.reflect.Array.get(_aidl_v, _aidl_i)));
29         }
30       } else {
31         if (_aidl_cls != int[].class) throw new IllegalArgumentException("wrong type: " + _aidl_cls);
32         for (int e : (int[]) _aidl_v) {
33           _aidl_sj.add(toString(e));
34         }
35       }
36       return _aidl_sj.toString();
37     }
38   }
39 }
40