(Object object)
| 112 | } |
| 113 | |
| 114 | public static String toString(Object object) { |
| 115 | if (object == null) { |
| 116 | return "null"; |
| 117 | } |
| 118 | if (!object.getClass().isArray()) { |
| 119 | return object.toString(); |
| 120 | } |
| 121 | if (object instanceof boolean[]) { |
| 122 | return Arrays.toString((boolean[]) object); |
| 123 | } |
| 124 | if (object instanceof byte[]) { |
| 125 | return Arrays.toString((byte[]) object); |
| 126 | } |
| 127 | if (object instanceof char[]) { |
| 128 | return Arrays.toString((char[]) object); |
| 129 | } |
| 130 | if (object instanceof short[]) { |
| 131 | return Arrays.toString((short[]) object); |
| 132 | } |
| 133 | if (object instanceof int[]) { |
| 134 | return Arrays.toString((int[]) object); |
| 135 | } |
| 136 | if (object instanceof long[]) { |
| 137 | return Arrays.toString((long[]) object); |
| 138 | } |
| 139 | if (object instanceof float[]) { |
| 140 | return Arrays.toString((float[]) object); |
| 141 | } |
| 142 | if (object instanceof double[]) { |
| 143 | return Arrays.toString((double[]) object); |
| 144 | } |
| 145 | if (object instanceof Object[]) { |
| 146 | return Arrays.deepToString((Object[]) object); |
| 147 | } |
| 148 | return "Couldn't find a correct type for the object"; |
| 149 | } |
| 150 | |
| 151 | @NonNull static <T> T checkNotNull(@Nullable final T obj) { |
| 152 | if (obj == null) { |
no outgoing calls